protected static void OnHotKeyPressed(HotKeyEventArgs e) { if (HotKeyManager.HotKeyPressed != null) { HotKeyManager.HotKeyPressed(null, e); } }
static void HotKey_OnKeyEvent(object sender, HotKeyEventArgs e) { Logger.WriteLine(string.Format("KeyDown {0}", e.KeyCode)); switch(e.KeyCode) { case Key.F1: case Key.F2: case Key.F3: case Key.F4: case Key.F5: case Key.F11: bStop = true; break; } }
private void handleHotkeyPress(object sender, HotKeyEventArgs e) { Console.WriteLine("Hotkey pressed: " + Name + e.HotKey.Key.ToString()); if (e.HotKey.Key == Key.O) { if (overlay.Visibility == Visibility.Hidden) overlay.Visibility = Visibility.Visible; else overlay.Visibility = Visibility.Hidden; } }
protected override void WndProc(ref Message m) { if (m.Msg == WM_HOTKEY) { HotKeyEventArgs e = new HotKeyEventArgs(m.LParam); HotKeyManager.OnHotKeyPressed(e); } base.WndProc(ref m); }
private void HandleHotkeyPress(object sender, HotKeyEventArgs e) { Logger.Debug("Hotkey pressed: " + Name + e.HotKey.Key); if (e.HotKey.Key == Key.O) { _overlay.Visibility = _overlay.Visibility == Visibility.Hidden ? Visibility.Visible : Visibility.Hidden; } if (e.HotKey.Key == Key.C) { if (_myClient.ClientSystem != null) { Clipboard.SetText(_myClient.ClientSystem); AppendStatus("Client system copied to clipboard."); } else { AppendStatus("No active rescue, copy to clipboard aborted."); } } }
void HotKeyManager_HotKeyPressed(object sender, HotKeyEventArgs e) { MessageBox.Show("Hello"); }
private void HotKeyHooked(object sender, HotKeyEventArgs e) { var handle = NativeMethods.GetForegroundWindow(); NativeMethods.PostMessage(handle, NativeConstants.WM_SYSCOMMAND, (uint)e.MenuItemId, 0); }
private static void HotKeyManagerOnHotKeyPressed(object sender, HotKeyEventArgs hotKeyEventArgs) { HotKeys[hotKeyEventArgs.Id].RaisePressed(); }
// ************************************************************************ void _hotKeyHandler_HotKeyPressed(object sender, HotKeyEventArgs e) { ActivateScreenSaver(); }