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

            OnSelectHotkey(e);
        }
예제 #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;
            }
        }
예제 #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;
            }
        }