Пример #1
0
        /// <summary>
        /// Subscribe to keyboard events
        /// </summary>
        private void subscribeToHookManager()
        {
            // Trap the keydown and key up events. Note
            // that the HookManager is a systemwide keyboard
            // trapper, not just for this application
            if (actuatorState != State.Running)
            {
                _keyboardHook              = new KeyboardHook();
                _keyboardHook.EvtKeyDown  += KeyboardHook_KeyDown;
                _keyboardHook.EvtKeyUp    += KeyboardHook_KeyUp;
                _keyboardHook.EvtKeyPress += KeyboardHook_KeyPress;
                _keyboardHook.SetHook();

                _mouseHook = new MouseHook();
                _mouseHook.EvtMouseDown += MouseHook_MouseDown;
                _mouseHook.SetHook();
            }
        }
Пример #2
0
        /// <summary>
        /// Subscribe to keyboard events
        /// </summary>
        private void subscribeToHookManager()
        {
            // Trap the keydown and key up events. Note
            // that the HookManager is a systemwide keyboard
            // trapper, not just for this application
            if (actuatorState != State.Running)
            {
                _keyboardHook = new KeyboardHook();
                _keyboardHook.EvtKeyDown += KeyboardHook_KeyDown;
                _keyboardHook.EvtKeyUp += KeyboardHook_KeyUp;
                _keyboardHook.EvtKeyPress += KeyboardHook_KeyPress;
                _keyboardHook.SetHook();

                _mouseHook = new MouseHook();
                _mouseHook.EvtMouseDown += MouseHook_MouseDown;
                _mouseHook.SetHook();
            }
        }