void kbdHook_KeyboardEvent(object sender, KeyboardEventArgs e)
 {
     if (currentTextBox != null)
     {
         var vk = e.KeyCode;
         if (vk != Keys.LMenu && vk != Keys.RMenu
             && vk != Keys.LWin && vk != Keys.RWin
             && vk != Keys.LShiftKey && vk != Keys.RShiftKey
             && vk != Keys.LControlKey && vk != Keys.RControlKey)
         {
             e.Handled = true;
         }
         Invoke((MethodInvoker)delegate { currentTextBox.Text = e.ToString(); });
         currentHotkey = e;
     }
 }
 void kbdHook_KeyboardEvent(object sender, KeyboardEventArgs e)
 {
     if (currentTextBox != null)
     {
         var vk = e.KeyCode;
         if (vk != Keys.LMenu && vk != Keys.RMenu &&
             vk != Keys.LWin && vk != Keys.RWin &&
             vk != Keys.LShiftKey && vk != Keys.RShiftKey &&
             vk != Keys.LControlKey && vk != Keys.RControlKey)
         {
             e.Handled = true;
         }
         Invoke((MethodInvoker) delegate { currentTextBox.Text = e.ToString(); });
         currentHotkey = e;
     }
 }
        void ResetCurrentHotkey()
        {
            switch (currentHotkeyType)
            {
            case HotKeyType.Switch:
                currentHotkey = settings.SwitchHotkey;
                break;

            case HotKeyType.Convert:
                currentHotkey = settings.ConvertSelectionHotkey;
                break;

            default:
                currentHotkey = null;
                break;
            }
            SetCurrentHotkeyInputText(currentHotkey == null ? "" : currentHotkey.ToString());
        }
        void ResetCurrentHotkey(bool clear)
        {
            switch (currentHotkeyType)
            {
            case HotKeyType.Switch:
                currentHotkey = clear ? null : settings.SwitchHotkey;
                break;

            case HotKeyType.Convert:
                currentHotkey = clear ? null : settings.ConvertSelectionHotkey;
                break;

            case HotKeyType.SwitchLayout:
                currentHotkey = clear ? null : settings.SwitchLayoutHotkey;
                break;

            default:
                currentHotkey = null;
                break;
            }
            SetCurrentHotkeyInputText(currentHotkey == null ? "None" : ReplaceCtrls(currentHotkey.ToString()));
        }
 void kbdHook_KeyboardEvent(object sender, KeyboardEventArgs e)
 {
     if (currentHotkeyType != HotKeyType.None)
     {
         var vk = e.KeyCode;
         if (vk == Keys.Escape || vk == Keys.Back)
         {
             e.Handled = true;
             ResetCurrentHotkey(vk == Keys.Back);
             return;
         }
         if (vk != Keys.LMenu && vk != Keys.RMenu &&
             vk != Keys.LWin && vk != Keys.RWin &&
             vk != Keys.LShiftKey && vk != Keys.RShiftKey &&
             vk != Keys.LControlKey && vk != Keys.RControlKey)
         {
             e.Handled = true;
         }
         SetCurrentHotkeyInputText(e.ToString());
         currentHotkey = e;
     }
 }
Exemple #6
0
 void ResetCurrentHotkey()
 {
     switch (currentHotkeyType)
     {
         case HotKeyType.Switch:
             currentHotkey = settings.SwitchHotkey;
             break;
         case HotKeyType.Convert:
             currentHotkey = settings.ConvertSelectionHotkey;
             break;
         default:
             currentHotkey = null;
             break;
     }
     SetCurrentHotkeyInputText(currentHotkey == null ? "" : currentHotkey.ToString());
 }
Exemple #7
0
 void kbdHook_KeyboardEvent(object sender, KeyboardEventArgs e)
 {
     if (currentHotkeyType != HotKeyType.None)
     {
         var vk = e.KeyCode;
         if (vk == Keys.Escape)
         {
             e.Handled = true;
             ResetCurrentHotkey();
             return;
         }
         if (vk != Keys.LMenu && vk != Keys.RMenu
             && vk != Keys.LWin && vk != Keys.RWin
             && vk != Keys.LShiftKey && vk != Keys.RShiftKey
             && vk != Keys.LControlKey && vk != Keys.RControlKey)
         {
             e.Handled = true;
         }
         SetCurrentHotkeyInputText(e.ToString());
         currentHotkey = e;
     }
 }
 void ResetCurrentHotkey(bool clear)
 {
     switch (currentHotkeyType)
     {
         case HotKeyType.Switch:
             currentHotkey = clear ? null : settings.SwitchHotkey;
             break;
         case HotKeyType.Convert:
             currentHotkey = clear ? null : settings.ConvertSelectionHotkey;
             break;
         case HotKeyType.SwitchLayout:
             currentHotkey = clear ? null : settings.SwitchLayoutHotkey;
             break;
         default:
             currentHotkey = null;
             break;
     }
     SetCurrentHotkeyInputText(currentHotkey == null ? "None" : ReplaceCtrls(currentHotkey.ToString()));
 }