コード例 #1
0
 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;
     }
 }
コード例 #2
0
 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;
     }
 }
コード例 #3
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());
        }
コード例 #4
0
ファイル: SettingsForm.cs プロジェクト: tsarisone/dotSwitcher
        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()));
        }
コード例 #5
0
ファイル: SettingsForm.cs プロジェクト: tsarisone/dotSwitcher
 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;
     }
 }
コード例 #6
0
ファイル: SettingsForm.cs プロジェクト: BOOMik/dotSwitcher
 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());
 }
コード例 #7
0
ファイル: SettingsForm.cs プロジェクト: BOOMik/dotSwitcher
 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;
     }
 }
コード例 #8
0
 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()));
 }