Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 21, 2021. It is now read-only.

A .NET library to subscribe for Windows operating system global user actions such mouse, keyboard, clipboard & print events

License

NotificationsYou must be signed in to change notification settings

justcoding121/windows-user-action-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note: This Project is no longer maintained.

A one stop library for global windows user actions such mouse, keyboard, clipboard, & print events

Build Status

Kindly report only issues/bugs here . For programming help or questions useStackOverflow with the tag EventHook or Windows-User-Action-Hook.

Supported Events

  • Keyboard events
  • Mouse events
  • clipboard events
  • application events
  • print events

Development enviroment

  • Visual Studio 2017

Usage

Install bynuget

Install-Package EventHook

Sample Code:

using(vareventHookFactory=newEventHookFactory()){varkeyboardWatcher=eventHookFactory.GetKeyboardWatcher();keyboardWatcher.Start();keyboardWatcher.OnKeyInput+=(s,e)=>{Console.WriteLine(string.Format("Key {0} event of key {1}",e.KeyData.EventType,e.KeyData.Keyname));};varmouseWatcher=eventHookFactory.GetMouseWatcher();mouseWatcher.Start();mouseWatcher.OnMouseInput+=(s,e)=>{Console.WriteLine(string.Format("Mouse event {0} at point {1},{2}",e.Message.ToString(),e.Point.x,e.Point.y));};varclipboardWatcher=eventHookFactory.GetClipboardWatcher();clipboardWatcher.Start();clipboardWatcher.OnClipboardModified+=(s,e)=>{Console.WriteLine(string.Format("Clipboard updated with data '{0}' of format {1}",e.Data,e.DataFormat.ToString()));};varapplicationWatcher=eventHookFactory.GetApplicationWatcher();applicationWatcher.Start();applicationWatcher.OnApplicationWindowChange+=(s,e)=>{Console.WriteLine(string.Format("Application window of '{0}' with the title '{1}' was {2}",e.ApplicationData.AppName,e.ApplicationData.AppTitle,e.Event));};varprintWatcher=eventHookFactory.GetPrintWatcher();printWatcher.Start();printWatcher.OnPrintEvent+=(s,e)=>{Console.WriteLine(string.Format("Printer '{0}' currently printing {1} pages.",e.EventData.PrinterName,e.EventData.Pages));};//waiting here to keep this thread runningConsole.Read();//stop watchingkeyboardWatcher.Stop();mouseWatcher.Stop();clipboardWatcher.Stop();applicationWatcher.Stop();printWatcher.Stop();}

alt tag

About

A .NET library to subscribe for Windows operating system global user actions such mouse, keyboard, clipboard & print events

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp