private static void OnHotKeyPressed(HotKeyEventArgs e) { if (SlowHotKeyManager.HotKeyPressed != null) { SlowHotKeyManager.HotKeyPressed(null, e); } }
protected override void WndProc(ref Message m) { if (m.Msg == WM_HOTKEY) { HotKeyEventArgs e = new HotKeyEventArgs(m.LParam); SlowHotKeyManager.OnHotKeyPressed(e); } base.WndProc(ref m); }
static void Main(string[] args) { // Schnell machen: HotKeyManager.RegisterHotKey(Keys.A, KeyModifiers.None); HotKeyManager.HotKeyPressed += new EventHandler <HotKeyEventArgs>(HotKeyManager_HotKeyPressed); // Langsam machen: SlowHotKeyManager.RegisterHotKey(Keys.B, KeyModifiers.Alt); SlowHotKeyManager.HotKeyPressed += new EventHandler <HotKeyEventArgs>(HotKeyManager_HotKeyPressedSlow); Console.ReadLine(); }