Example #1
0
 public Switcher()
 {
     kbdHook = new KeyboardHook();
     kbdHook.KeyboardEvent += ProcessKeyPress;
     mouseHook = new MouseHook();
     mouseHook.MouseEvent += ProcessMousePress;
 }
Example #2
0
 public Switcher(ISettings settings)
 {
     this.settings = settings;
     kbdHook = new KeyboardHook();
     kbdHook.KeyboardEvent += ProcessKeyPress;
     mouseHook = new MouseHook();
     mouseHook.MouseEvent += ProcessMousePress;
 }
 public SettingsForm(Settings settings)
 {
     this.settings = settings;
     currentTextBox = null;
     kbdHook = new KeyboardHook();
     kbdHook.KeyboardEvent += kbdHook_KeyboardEvent;
     InitializeComponent();
     InitializeValues();
 }
Example #4
0
 void InitializeHotkeyBoxes()
 {
     textBoxSwitchHotkey.GotFocus        += (s, e) => currentHotkeyType = HotKeyType.Switch;
     textBoxSwitchHotkey.Enter           += (s, e) => currentHotkeyType = HotKeyType.Switch;
     textBoxSwitchHotkey.LostFocus       += (s, e) => ApplyCurrentHotkey();
     textBoxSwitchHotkey.Leave           += (s, e) => ApplyCurrentHotkey();
     textBoxConvertHotkey.GotFocus       += (s, e) => currentHotkeyType = HotKeyType.Convert;
     textBoxConvertHotkey.Enter          += (s, e) => currentHotkeyType = HotKeyType.Convert;
     textBoxConvertHotkey.LostFocus      += (s, e) => ApplyCurrentHotkey();
     textBoxConvertHotkey.Leave          += (s, e) => ApplyCurrentHotkey();
     textBoxSwitchLayoutHotkey.GotFocus  += (s, e) => currentHotkeyType = HotKeyType.SwitchLayout;
     textBoxSwitchLayoutHotkey.Enter     += (s, e) => currentHotkeyType = HotKeyType.SwitchLayout;
     textBoxSwitchLayoutHotkey.LostFocus += (s, e) => ApplyCurrentHotkey();
     textBoxSwitchLayoutHotkey.Leave     += (s, e) => ApplyCurrentHotkey();
     currentHotkeyType      = HotKeyType.None;
     kbdHook                = new KeyboardHook();
     kbdHook.KeyboardEvent += kbdHook_KeyboardEvent;
 }
Example #5
0
 void InitializeHotkeyBoxes()
 {
     textBoxSwitchHotkey.GotFocus += (s, e) => currentHotkeyType = HotKeyType.Switch;
     textBoxSwitchHotkey.Enter += (s, e) => currentHotkeyType = HotKeyType.Switch;
     textBoxSwitchHotkey.LostFocus += (s, e) => ApplyCurrentHotkey();
     textBoxSwitchHotkey.Leave += (s, e) => ApplyCurrentHotkey();
     textBoxConvertHotkey.GotFocus += (s, e) => currentHotkeyType = HotKeyType.Convert;
     textBoxConvertHotkey.Enter += (s, e) => currentHotkeyType = HotKeyType.Convert;
     textBoxConvertHotkey.LostFocus += (s, e) => ApplyCurrentHotkey();
     textBoxConvertHotkey.Leave += (s, e) => ApplyCurrentHotkey();
     currentHotkeyType = HotKeyType.None;
     kbdHook = new KeyboardHook();
     kbdHook.KeyboardEvent += kbdHook_KeyboardEvent;
 }