public KeyBoardHookHotKey() { _hook = new KeyboardHook(); _hook.KeyDown += new System.Windows.Forms.KeyEventHandler(HookKeyDown); }
/// <summary> /// Makes a snapshot of a keyboard state to the moment of call and returns an /// instance of <see cref="KeyboardState"/> class. /// </summary> /// <returns>An instance of <see cref="KeyboardState"/> class representing a snapshot of keyboard state at certain moment.</returns> public static KeyboardState GetCurrent() { byte[] keyboardStateNative = new byte[256]; KeyboardHook.GetKeyboardState(keyboardStateNative); return(new KeyboardState(keyboardStateNative)); }