The WH_KEYBOARD_LL hook enables you to monitor keyboard input events about to be posted in a thread input queue.
For more information, see the LowLevelKeyboardProc function.