C# Class Utilities.globalKeyboardHook

A class that manages a global low level keyboard hook
Mostra file Open project: Afkbio/diabloitemcapture Class Usage Examples

Public Properties

Property Type Description
HookedKeys List

Public Methods

Method Description
globalKeyboardHook ( ) : System

Initializes a new instance of the globalKeyboardHook class and installs the keyboard hook.

hook ( ) : void

Installs the global hook

hookProc ( int code, int wParam, keyboardHookStruct &lParam ) : int

The callback for the keyboard hook

unhook ( ) : void

Uninstalls the global hook

Private Methods

Method Description
CallNextHookEx ( IntPtr idHook, int nCode, int wParam, keyboardHookStruct &lParam ) : int
LoadLibrary ( string lpFileName ) : IntPtr
SetWindowsHookEx ( int idHook, keyboardHookProc callback, IntPtr hInstance, uint threadId ) : IntPtr
UnhookWindowsHookEx ( IntPtr hInstance ) : bool

Method Details

globalKeyboardHook() public method

Initializes a new instance of the globalKeyboardHook class and installs the keyboard hook.
public globalKeyboardHook ( ) : System
return System

hook() public method

Installs the global hook
public hook ( ) : void
return void

hookProc() public method

The callback for the keyboard hook
public hookProc ( int code, int wParam, keyboardHookStruct &lParam ) : int
code int The hook code, if it isn't >= 0, the function shouldn't do anyting
wParam int The event type
lParam keyboardHookStruct The keyhook event information
return int

unhook() public method

Uninstalls the global hook
public unhook ( ) : void
return void

Property Details

HookedKeys public_oe property

The collections of keys to watch for
public List HookedKeys
return List