public void OnClick() { if (listeningToButton == null) { listeningToButton = this; } SelectHotkeyEventArgs e = new SelectHotkeyEventArgs(); OnSelectHotkey(e); }
private static void StaticGlobalMousePress(object sender, MouseEventArgs e) { if (listening) { listeningToButton.mouseButton = e.Button; listeningToButton.hotkeyType = HotkeyType.mouseButton; HotkeySetEventArgs ev = new HotkeySetEventArgs(); listeningToButton.OnHotkeySet(ev); listeningToButton = null; lastSet = DateTime.Now; return; } }
private static void StaticGlobalHookKeyDown(object sender, KeyEventArgs e) { if (listening) { listeningToButton.key = e.KeyCode; listeningToButton.hotkeyType = HotkeyType.key; HotkeySetEventArgs ev = new HotkeySetEventArgs(); listeningToButton.OnHotkeySet(ev); listeningToButton = null; lastSet = DateTime.Now; return; } }