KeyboardMouseHooks

Jan 22, 2011   //   by Ramas   //   Project, Software  //  No Comments

KeyboardMouseHooks Demo

Description

KeyboardMouseHooks C# Library is part of RamGec Tools collection for .NET developers. It enables you, in a very easy, optimized and OO-way, via C# events system to install and track low level Windows keyboard and mouse hooks. Library consists of two separate classes (KeyboardHook and MouseHook). Check compiled demo application to see all of its features.

Supported Hook Events

#region Events
public event KeyboardHookCallback KeyDown;
public event KeyboardHookCallback KeyUp;
#endregion
#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

Features

You can see and test all available features in this small demo application.

  • Capture all Keyboard and Mouse events.
  • OO classes using “event” methods for maximum usability.
  • Simple, lightweight, efficient, performance oriented and easy to use.
  • Free to use (MIT license), modify or expand.

Usage

// 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

Download

Leave a comment

Hey There!

Ramunas Geciauskas

  Hey, I'm Ramas. I'm a Software Engineer, focusing on converting complex and unusual ideas into reality. I mainly work as a freelance developer, creating various web start-ups or unique software applications.

  On my spare time, I enjoy photography, admire art, and read all kinds of scientific papers.