Example #1
0
        public void OnClick()
        {
            if (listeningToButton == null)
            {
                listeningToButton = this;
            }
            SelectHotkeyEventArgs e = new SelectHotkeyEventArgs();

            OnSelectHotkey(e);
        }
Example #2
0
        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;
            }
        }
Example #3
0
        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;
            }
        }