Questions tagged [mousekeyhook]

The .NET library allows you to tap keyboard and mouse, to detect and record their activity even when an application is inactive and runs in background.

Introduction

This library attaches to windows global hooks, tracks keyboard and mouse clicks and movement and raises common .NET events with KeyEventArgs and MouseEventArgs, so you can easily retrieve any information you need:

  • Mouse coordinates
  • Mouse buttons clicked
  • Mouse wheel scrolls
  • Key presses and releases
  • Special key states

    Additionally, there are MouseEventExtArgs and KeyEventExtArgs which provide further options:

  • Input suppression
  • Timestamp
  • IsMouseDown/Up
  • IsKeyDown/Up.

Prerequisites

  • Windows: .Net 4.0+

Installation and sources

  nuget install MouseKeyHook

Troubleshooting and support

37 questions
0
votes
1 answer

How to get the handle of application that received the mousedoubleclick?

Is it possible to get the handle of the Window the user clicked (or in my case double-clicked) on? Adding more detail: I have an application that when launched by the user, watches for a specific hot key (CTL+SHIFT+T). When pressed, my application…
Jerome
  • 3
  • 3
0
votes
1 answer

How to ask keyboard hook to process messages AFTER the parent window

The title says it all. How can I ask my keyboard hook to tackle incoming keyboard message AFTER the parent window has processed them? Reading the docs I found there is a value named WH_CALLWNDPROCRET that does exactly this, but I need to specify…
dotNET
  • 33,414
  • 24
  • 162
  • 251
0
votes
1 answer

Using programmable keys in C#?

I am wanting to create a simple application that when running would wait for a specific key or combination of keys OR even button presses on a mouse. I am using the MouseKeyHook API in order to get this information, however I am running into a few…
Hunter Mitchell
  • 7,063
  • 18
  • 69
  • 116
0
votes
1 answer

MouseKeyHook application lags on boot and can't be closed

I've written a simple auto clicker using MouseKeyHook. The reason I use MouseKeyHook is to detect global left clicks throughout Windows OS. Although, when I run the .exe, the software lags on the click and after a while I can't seem to hit the 'X'…
user3454669
0
votes
1 answer

WPF using mousekeyhook library to count clicks - LoaderLock error

I want to write an application that counts number of mouse clicks in windows. After some research I have found this library: MouseKeyHook I have created wpf application and copied the example code: public partial class MainWindow : Window { …
user3662546
  • 87
  • 12
0
votes
1 answer

Key listener not firing (MouseKeyHook)

I'm starting out in C#, coded a lot in Java but having some trouble here. I'm trying to learn how to use MouseKeyHook for an application I'm developing. I cannot get the actual listener to fire off an event. Here's my listener code: using…
segfault
  • 13
  • 5
-1
votes
2 answers

In mousekeyhook, What does the "ext' after the mouse hooks mean?

For example, there is IKeyboardMouseEvent.MouseDown and IKeyboardMouseEvent.MouseDownExt. What is the difference? Thanks
osum4est
  • 55
  • 3
1 2
3