Ejemplo n.º 1
0
 private void HookKeyPress(object sender, KeyEventArgs eventArgs)
 {
     _logger.LogKey($"| {DateTime.Now} | : {eventArgs.KeyData.ToString()}");
     if (eventArgs.KeyData == (Keys.PrintScreen))
     {
         //eventArgs.Handled = true;
         SaveScreenShot();
     }
     if (eventArgs.KeyData.ToString().Equals("Tab, Control"))
     {
         _handler.Invoke(false);
     }
 }
 private void HookKeyPress(object sender, KeyEventArgs eventArgs)
 {
     _logger.LogKey("| " + DateTime.Now + " | : " + eventArgs.KeyData);
     if (eventArgs.KeyData == (Keys.Control | Keys.Alt | Keys.Q))
     {
         eventArgs.Handled = true;
         CloseActiveWindow();
     }
     if (eventArgs.KeyData == (Keys.Alt | Keys.F4))
     {
         eventArgs.Handled = true;
         _handler.Invoke(false);
     }
     if (eventArgs.KeyData == (Keys.Control | Keys.Alt | Keys.U))
     {
         eventArgs.Handled = true;
         Application.Exit();
     }
 }