Example #1
0
 public void UnregisterByKey(DDHotkey hotkey)
 {
     if (_hotkeytypelookup.ContainsKey(hotkey))
     {
         this.UnregisterByType(_hotkeytypelookup[hotkey]);
     }
 }
Example #2
0
        public void Register(DDHotkeyType type, DDHotkey hotkey)
        {
            this.UnregisterByType(type);
            this.UnregisterByKey(hotkey);

            _hotkeys.Add(type, hotkey);
            _hotkeytypelookup.Add(hotkey, type);
            _hotkeymanager.Register(hotkey.Key, hotkey.Modifier);
        }
Example #3
0
        private void _hotkeymanager_KeyPressed(object sender, KeyPressedEventArgs e)
        {
            var kp = new DDHotkey(e.HotKey);

            if (_hotkeytypelookup.ContainsKey(kp))
            {
                switch (_hotkeytypelookup[kp])
                {
                case DDHotkeyType.DialSelectionFromActiveWindow:
                    var numbers = _phonenumbergrabber.TryGrabPhonenumbersFromSelection(Properties.Settings.Default.GrabMinLength);
                    if (numbers.Length > 0)
                    {
                        DialRequest(this, new DialRequestEventArgs(numbers));
                    }
                    break;
                }
            }
        }