/// <summary> /// Watching for user action /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CoreClockTick(object sender, EventArgs e) { _action = KeyCatcher.DetectAnyHotkeyPress(); if (_action != Enums.Action.None) { HotkeyPressReaction(_action); _coreClock.IsEnabled = false; Thread.Sleep(320); _coreClock.IsEnabled = true; } }
/// <summary> /// Assigning keyboard key to app action /// </summary> /// <param name="keyName"> Key name for display in view </param> /// <param name="virtualKey"> Virtual key code for watching press on it </param> private void AssignBindKey(string keyName, int virtualKey) { if (_isAssignHotkeyAvailable) { KeyCatcher.SetKey(virtualKey, _selectedKey); isCheckedNextClipboardHotkey = false; isCheckedPreviousClipboardHotkey = false; switch (_selectedKey) { case Enums.KeyType.Next: nextBindKeyName = keyName; break; case Enums.KeyType.Previous: previousBindKeyName = keyName; break; } } }