コード例 #1
0
 //Used to clean all key strokes. Useful in case of unexpected bugs
 public void Shutdown()
 {
     _keyboardHooker.StopHook();
     _keyboardHooker.KeyHooked             -= HandleHookedEventAsync;
     _applicationModel.ActivationKeyChange -= OnActivationKeyChanged;
     //For sure
     InputSimlationHelper.UpAllModifiers();
     InputSimlationHelper.UpAllModifiers();
 }
コード例 #2
0
        private void ProcessHotkeyAction(Hotkey hotkey, bool isDown)
        {
            _keyboardHooker.StopHookKeyboard();

            Debug.WriteLine($"trigger : {hotkey.Trigger}  |  action : {hotkey.Action}");

            if (isDown)
            {
                InputSimlationHelper.DownKey(hotkey.Action, _options.MouseDownDelayMiliseconds);
            }
            else
            {
                InputSimlationHelper.UpKey(hotkey.Action, _options.MouseUpDelayMiliseconds);

                if (hotkey.EndingAction != null)
                {
                    InputSimlationHelper.PressKey(hotkey.EndingAction);
                }
            }

            _keyboardHooker.StartHookKeyboard();
        }