/// <summary> /// Initialize a new instance of the <see cref="KeyboardHook"/> class. /// </summary> internal KeyboardHook() { _keyboardHookProcHandle = KeyboardHookProc; _isPaused = true; Resume(); EventsHistory = new List <KeyboardHookEventArgs>(); HistoryLimit = 100; HandleKeyboardKeyPress = true; HandleKeyboardKeyRelease = true; }
/// <summary> /// Initialize a new instance of the <see cref="MouseHook"/> class. /// </summary> internal MouseHook() { _lastMouseCoords = new Point(); NativeMethods.GetCursorPos(ref _lastMouseCoords); _mouseHookProcHandle = MouseHookProc; _isPaused = true; Resume(); EventsHistory = new List <MouseHookEventArgs>(); LeftMouseButtonState = KeyState.Released; RightMouseButtonState = KeyState.Released; HistoryLimit = 100; HandleMouseButtonDown = true; HandleMouseButtonUp = true; HandleMouseMove = true; HandleMouseWheel = true; }
internal static extern IntPtr SetWindowsHookEx(HookType hookType, HookProcCallback lpfn, IntPtr hMod, uint dwThreadId);