Exemple #1
0
        /// <summary>
        /// Creates a new instance of <see cref="MouseKeyHook"/>.
        /// </summary>
        public MouseKeyHook(MouseClickSettings mouseClickSettings,
                            KeystrokesSettings keystrokesSettings,
                            KeymapViewModel keymap,
                            string fileName,
                            Func <TimeSpan> elapsed)
        {
            _mouseClickSettings = mouseClickSettings;
            _keystrokesSettings = keystrokesSettings;
            _keymap             = keymap;

            _hook = Hook.GlobalEvents();

            _hook.MouseDown += (sender, e) =>
            {
                _mouseClicked = true;

                _mouseButtons = e.Button;
            };

            _hook.MouseUp += (sender, e) => _mouseClicked = false;

            if (keystrokesSettings.SeparateTextFile)
            {
                _textWriter = InitKeysToTextFile(fileName, elapsed);
            }
            else
            {
                _records = new KeyRecords(keystrokesSettings.HistoryCount);

                _hook.KeyDown += OnKeyDown;
                _hook.KeyUp   += OnKeyUp;
            }
        }
Exemple #2
0
        public ScrollOverlay(IMouseKeyHook Hook,
                             MouseClickSettings Settings)
        {
            _settings = Settings;

            Hook.MouseWheel += (S, E) => _lastArgs = E;
        }
Exemple #3
0
        /// <summary>
        /// Creates a new instance of <see cref="MouseKeyHook"/>.
        /// </summary>
        public MouseKeyOverlay(IMouseKeyHook Hook,
                               MouseClickSettings MouseClickSettings,
                               KeymapViewModel Keymap,
                               string FileName,
                               Func <TimeSpan> Elapsed)
        {
            _keymap = Keymap;

            _hook = Hook;
            _mouseClickOverlay = new MouseClickOverlay(_hook, MouseClickSettings);
            _scrollOverlay     = new ScrollOverlay(_hook, MouseClickSettings);
        }
        public MouseClickOverlay(IMouseKeyHook Hook,
                                 MouseClickSettings Settings)
        {
            _settings = Settings;

            Hook.MouseDown += (S, E) =>
            {
                _clicked = true;

                _buttons = E.Button;
            };

            Hook.MouseUp += (S, E) => _clicked = false;
        }
Exemple #5
0
        /// <summary>
        /// Creates a new instance of <see cref="MouseKeyHook"/>.
        /// </summary>
        public MouseKeyOverlay(IMouseKeyHook Hook,
                               MouseClickSettings MouseClickSettings,
                               KeystrokesSettings KeystrokesSettings,
                               KeymapViewModel Keymap,
                               string FileName,
                               Func <TimeSpan> Elapsed)
        {
            _keystrokesSettings = KeystrokesSettings;
            _keymap             = Keymap;

            _hook = Hook;
            _mouseClickOverlay = new MouseClickOverlay(_hook, MouseClickSettings);

            if (KeystrokesSettings.SeparateTextFile)
            {
                _textWriter = InitKeysToTextFile(FileName, Elapsed);
            }
            else
            {
                _keyOverlay = new KeyOverlay(_hook, KeystrokesSettings, Keymap);
            }
        }