Advertisement
3_2004-2005 Files/ File Controls/ Input/ Output #148853

Low-Level Keyboard Hooks

This is a .net class library (KeyboardLowLevelHook) to capture low-level keyboard events by placing a low-level system hook. Use this to track when a user presses some key / key combinations (in any program) and react to those events. The way these functionalities are exposed is very similar to the .net keyboard input scheme : the KeyboardLowLevelHook provides two events : KeyDown and KeyUp (same as on Windows Forms) that, upon instantiation of the class, fires whenever any key gets pressed / released. You can also prevent (block) key combinations from reaching other programs by setting e.Handled = True in the KeyDown and KeyUp events (see example). Note : Be careful when a KeyboardLowLevelHook is instantiated when debugging : keyboard input will react very slowly since the “hook callback procedure” cannot be called when the program is paused. Low-level keyboard hooks require at least Windows NT 4.0 SP3 to run. *Vote only if you wish to... Voting is voluntary : users should not be forced to vote. If you don't want to vote, that's OK! Simply don't vote!*

AI

Résumé par IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Code source
original-source
Upload
Commentaires originaux (3)
Récupéré via Wayback Machine