Beispiel #1
0
 public Hotkey(IKeyTracker keyTracker, params IKeyCombo[] combos)
 {
     _keyTracker = keyTracker;
     _combos     = combos.ToList();
     ResetEnumerator();
     _keyTracker.KeyPressed   += OnKeyPressed;
     _keyTracker.KeyUnpressed += OnKeyUnpressed;
 }
        public CopypastaController(IClipboard clipboard, IClipboardHistoryManager clipboardHistoryManager,
                                   IClipboardBindingManager clipboardBindingManager, IHotkey ctrlVHotkey, IHotkey ctrlCHotkey, IHotkey escHotkey,
                                   IKeyTracker keyTracker, IInputSimulator inputSimulator, INotificationDispatcher notificationDispatcher)
        {
            _clipboard = clipboard;
            _clipboardHistoryManager = clipboardHistoryManager;
            _clipboardBindingManager = clipboardBindingManager;
            _ctrlVHotkey             = ctrlVHotkey;
            _ctrlCHotkey             = ctrlCHotkey;
            _escHotkey              = escHotkey;
            _keyTracker             = keyTracker;
            _inputSimulator         = inputSimulator;
            _notificationDispatcher = notificationDispatcher;
            _copypastaStateMachine  = new StateMachine <CopypastaState, CopypastaTrigger>(CopypastaState.Idle);
            _keyPressedTrigger      = _copypastaStateMachine.SetTriggerParameters <Key>(CopypastaTrigger.KeyPressed);

            ConfigureCopypastaStateMachine();
            ConfigureEventTriggers();
        }