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
1
vote
0 answers

Key event + modifier keys not working properly

I've seen countless of posts and articles claiming to do what I expect them to do for me, sadly none of them has granted me a solution or helped me so far. You see, I'm using: https://github.com/gmamaladze/globalmousekeyhook as a Keyboard…
ULI-R0
  • 171
  • 8
1
vote
1 answer

Suppressing global windows shortcuts while recording keypresses

Is it possible to suppress the windows global shortcuts while recording keypresses ? I have a Windows Form application written in c#, and using this library to record keypresses to use later in macros. Now when I record the key combinations that are…
Tom
  • 84
  • 1
  • 1
  • 5
1
vote
1 answer

Mouse Key Hook - Key listener not firing

I'm using the Global MouseKeyHook to listen, for both mouse clicks and key presses, whilst playing a video in a VLC activeX control. The mouse click listener triggers fine, and works as expected. But the key press/down listeners don't fire. I've…
Sandwich
  • 356
  • 7
  • 18
1
vote
0 answers

C# MouseKeyHook key suppression problems

I've been using the MouseKeyHook NuGet package for a project where a single key press needs to be monitored to provide explicit functionality. The prototype application I have written, checks the required key is pressed and then sets the Handled…
Erminh
  • 11
  • 1
0
votes
0 answers

MouseKeyHook not catching event to get selected text from different apps

I'm building a word lookup application that runs in system tray and when you scan a block of a few words and then press a hotkey combination like Shift + C + V for example. However, the problem is that when I test it on my personal machine, it works…
Quang Tran
  • 11
  • 2
0
votes
1 answer

PPT VSTO: how to excute shortcut over office's internal command

I was lucky to find one project called globalmousekeyhook, by which I can set a shortcut to my PPT VSTO addin. The core part code is as below. When I pressed the defined shortcut, both my addin's function and PPT's internal command will be…
Valuex
  • 104
  • 1
  • 10
0
votes
0 answers

Problems with Keyboard Events in library “globalmousekeyhook”

When using library "globalmousekeyhook", two problems arose: Problem #1: Global events do not work when called from a separate class - If place the code to activate Global Events in a separate class (in a method) and then call it from the main form…
Ilya
  • 59
  • 6
0
votes
2 answers

How to cancel left mouse down without click on C#?

I'm try to wrote app, that will send right click, when user take long press left mouse button. I found https://github.com/gmamaladze/globalmousekeyhook project and hook events with it. When I hook left up, then send right click with mouse event,…
gvozd1989
  • 300
  • 1
  • 16
0
votes
1 answer

C# MouseKeyHook: Certain Key + Modifier Combinations Not Working

I've been working with the MouseKeyHook NuGet package, and it's working great for capturing most input. But I'm having some problems catching certain combinations of keys + modifiers. public static class InputHandler { private static…
0
votes
0 answers

Hook to select Process

how to use this lib to hook key and mouse to target process not global not my app public void Subscribe() { // Note: for the application hook, use the Hook.AppEvents() instead m_GlobalHook = Hook.GlobalEvents(); …
0
votes
1 answer

Absolute minimum code to detect keypresses via mousekeyhook C#

I want to create a log of keypresses in C#. I found keymousehook but I don't get how to use it. I couldn't find a comprehensive guide or a blog post. The documentation isn't really helpful either. What is the absolute minimum code to detect…
user6879072
  • 441
  • 1
  • 7
  • 17
0
votes
1 answer

How to get the "ctrl c" or mouse copy event in a Powerpoint 2013 Addin (developed in C#)?

Code below is not trapping character type in MS Powerpoint, It does just outside of Powerpoint and how can I catch the "control copy" or "right mouse click copy" inside this code? Code below is not trapping character type in MS Powerpoint, It does…
0
votes
1 answer

Equivalent to IsDisposed using c# wpf

I am working on a custom keycasting program for tut videos and I am using MouseKeyHook and I am using the example code found here: https://github.com/gmamaladze/globalmousekeyhook/blob/vNext/Demo/Main.cs to get the basic construction working. As the…
drume
  • 33
  • 10
0
votes
1 answer

ManagementObjectSearcher does not work within global hook

When I try to get all running processes inside mouse event handler it throws an exception. First I thought that the problem persists because I put async keyword before mouse event handler, but it was not the case, as the exception is thrown also for…
Mr. Blond
  • 1,113
  • 2
  • 18
  • 41
0
votes
0 answers

MouseKeyHook "strong name required"

I implemented an application which uses the Nuget package MouseKeyboardActivityMonitor. Everything was working fine so far. I now wanted to build a Setup Project to deploy the application on other computers. Therefore I had to sign my project. Since…
Laszlo
  • 1