gmamaladze / globalmousekeyhook

This library allows you to tap keyboard and mouse, detect and record their activity even when an application is inactive and runs in background.
MIT License
1.05k stars 257 forks source link

Unable to ignore/pass CTRL-keys during key events.... #94

Open smarrocco opened 6 years ago

smarrocco commented 6 years ago

I am globally capturing keyup events from my apps, logging them as they happen. When a user types keys in an app, my vb.net app captures them into a log for later debugging. However, while my capturing app is running, the user is unable to use CTRL-C, -X and -V for copy, cut and paste in any application. Those hot-keys/functions in all other applications seem to be defeated by my capturing application.

I would expect that, like other keystrokes that are passed to the user's app after being captured, that the cut/copy/paste keystrokes would do so as well. I tried placing e.handler=true and e.suppresskeypress=true in various combinations in the keyup event of my app when CTRL-C was detected, but this seemed to make no difference.

How can I continue to capture all keystrokes except CTRL-C, -X and -V, allowing them to continue as copy, cut and paste is all global applications?

javon27 commented 6 years ago

Setting those values to true tells Windows that your app is the only one allowed to listen to those key press events. You will want to leave them alone or set them to false if you want the events to pass through.

j3dd commented 5 years ago

Don't forget to add e.handled and e.suppresskeypress = true to the KeyDown event as well.