private void Hook_KeyboardPressed(object sender, GlobalKeyboardHookEventArgs e) { var virtualCode = e.KeyboardData.VirtualCode; if (e.KeyboardState == GlobalKeyboardHook.KeyboardState.KeyDown || e.KeyboardState == GlobalKeyboardHook.KeyboardState.SysKeyDown) { if (!_currentlyPressedKeys.Contains(virtualCode)) { _currentlyPressedKeys.Add(virtualCode); } } else if (e.KeyboardState == GlobalKeyboardHook.KeyboardState.KeyUp || e.KeyboardState == GlobalKeyboardHook.KeyboardState.SysKeyUp) { if (_currentlyPressedKeys.Contains(virtualCode)) { _currentlyPressedKeys.Remove(virtualCode); } } _currentlyPressedKeys.Sort(); if (ArraysAreSame(_currentlyPressedKeys, _activationKeys)) { _appStateHandler.ShowColorPicker(); } if (_currentlyPressedKeys.Count == 1 && _currentlyPressedKeys[0] == 27) { _colorsHistoryWindowHelper.HideColorsHistory(); _zoomWindowHelper.CloseZoomWindow(); } }
private void CircularMenuItem_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { ClipboardHelper.CopyIntoClipboard(CentralItem.ContentText); if (_colorsHistoryWindowHelper == null) { _colorsHistoryWindowHelper = Bootstrapper.Container.GetExportedValue <ColorsHistoryWindowHelper>(); } _colorsHistoryWindowHelper.HideColorsHistory(); }