Example #1
0
        public bool UnregisterHotkey(HotkeyInfo hotkeyInfo)
        {
            if (hotkeyInfo != null)
            {
                if (hotkeyInfo.ID > 0)
                {
                    bool result = NativeMethods.UnregisterHotKey(Handle, hotkeyInfo.ID);

                    if (result)
                    {
                        NativeMethods.GlobalDeleteAtom(hotkeyInfo.ID);
                        hotkeyInfo.ID     = 0;
                        hotkeyInfo.Status = HotkeyStatus.NotConfigured;
                        return(true);
                    }
                }

                hotkeyInfo.Status = HotkeyStatus.Failed;
            }

            return(false);
        }
Example #2
0
 public void Reset()
 {
     EditingHotkey = false;
     HotkeyInfo    = new HotkeyInfo();
     SetDefaultButtonText();
 }
Example #3
0
 public void UpdateHotkey(HotkeyInfo hotkeyInfo)
 {
     HotkeyInfo = hotkeyInfo;
     UpdateHotkeyText();
 }
Example #4
0
 private void UpdateHotkeyText()
 {
     Text = HotkeyInfo.ToString();
     Invalidate();
 }