Caveats
Performance might be an issue when you
use the WH_KEYBOARD and
WH_KEYBOARD_LL hooks, especially with system-wide
and low-level keyboard hooks. You should use these hooks judiciously.
The low-level keyboard hook forces every thread to receive messages from a single queue. This is how 16-bit Windows operating systems work. Therefore, the operating system cannot take advantage of multitasking. A problem that occurs in all 16-bit Windows operating systems can now occur in 32-bit Windows operating systems: a single application can hang all applications, even the desktop.
Because low-level keyboard hooks serialize all input to all windows, there is a large performance penalty. You should be careful when using hooks such as these. When you use these hooks, install them for as little time as possible.
Also, when using the WH_KEYBOARD_LL low-level
keyboard hook, note that the debug hook cannot receive the input to
this hook before the hook is called. The debug hook works normally
with the keyboard hook (WH_KEYBOARD). Chapter 21 describes the debug hook.
When using Windows NT or Windows 2000 along with the enhanced Windows keyboards, note that the keys, which are duplicated on the left and right, now have different virtual key codes. Here is a list of left and right virtual key codes:
-
VK_LWINandVK_RWIN The left and right virtual key codes for the Windows keys
-
VK_LSHIFTandVK_RSHIFT The left and right virtual key codes for the shift keys
-
VK_LCONTROLandVK_RCONTROL The left and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access