KeyboardHook Supported Events
#region Events
public event KeyboardHookCallback KeyDown;
public event KeyboardHookCallback KeyUp;
#endregion


MouseHook Supported Events
#region Events
public event MouseHookCallback LeftButtonDown;
public event MouseHookCallback LeftButtonUp;
public event MouseHookCallback RightButtonDown;
public event MouseHookCallback RightButtonUp;
public event MouseHookCallback MouseMove;
public event MouseHookCallback MouseWheel;
public event MouseHookCallback DoubleClick;
public event MouseHookCallback MiddleButtonDown;
public event MouseHookCallback MiddleButtonUp;
#endregion


Using KeyboardMouseHooks
// initialize both classes
RamGecTools.MouseHook mouseHook = new RamGecTools.MouseHook();
RamGecTools.KeyboardHook keyboardHook = new RamGecTools.KeyboardHook();
 
// add as many events as you like
mouseHook.MouseMove += new RamGecTools.MouseHook.MouseHookCallback(mouseHook_MouseMove);
keyboardHook.KeyDown += new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyDown);
// ...
 
// install hooks
mouseHook.Install();
keyboardHook.Install();
 
// once specified event happens, your registered method will be fired
// MouseHook uses MouseHookCallback delegate
// KeyboardHook uses KeyboardHookCallback delegate


You can find a fully working example which demonstrates all KeyboardMouseHooks features in the Download page

Last edited Jan 22, 2011 at 2:22 PM by qisur, version 1

Comments

alexeyd Feb 24, 2016 at 7:59 AM 
Is it possible to catch keys combination like ctrl+c or something like that?