C# Class ULib.Core.NativeSystem.Native

A class that manages a global low level keyboard hook
Datei anzeigen Open project: mind0n/hive

Public Properties

Property Type Description
HookedKeys List

Public Methods

Method Description
Hook ( ) : void

Installs the global hook

Native ( ) : System

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

Unhook ( ) : void

Uninstalls the global hook

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

The callback for the keyboard hook

Private Methods

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

Method Details

Hook() public method

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

Native() public method

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

Unhook() public method

Uninstalls the global hook
public Unhook ( ) : 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

Property Details

HookedKeys public_oe property

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