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.04k stars 257 forks source link

Added option to detect if mouse and keyboard events are injected and not real events from the keyboard and mouse #185

Open Alecu100 opened 8 months ago

Alecu100 commented 8 months ago

I needed to be able to detect if a mouse or keyboard event was injected using one of the windows inject primitives, in my case SendInput, to only allow injected events and suppress events from the real keyboard and mouse.

So I added a new property in the KeyEventArgsExt and MouseEventExtArgs called IsInjected that is set to true of the event is injected and not a real event from the keyboard or mouse.

And I added new keyboard events with the extended keyboard arguments to make the new functionality more easily accessible and similar to how mouse events are handled. Things are a bit more consistent now.

I also updated the targets to include .net 8 and increased the version to 5.8 because it has some new features.

Would it be possible to make a new nuget release from these updates, to bump the nuget package to version 5.8?

I know this merge is just for the vnext branch, I think then it needs to be merged in the main branch and then a release needs to be made for the nuget package.

Alecu100 commented 8 months ago

I need to investigate why the unit test fails, locally it passed. It still seems to pass locally, can't replicate the failure.

Alecu100 commented 8 months ago

@gmamaladze Small reminde of this pull request, not sure if you saw the request.

Alecu100 commented 7 months ago

@gmamaladze Sorry to bother, just making sure that this pull request is still alive and will eventually get merged and a new nuget version of the package gets released. Would really need this for work, it's the best package that does what I need. Thanks!

Alecu100 commented 7 months ago

@gmamaladze I made another version of the library that supports detection of injected events and posted it on nuget in order to finish the work and have our new feature running in our application. Hope this will eventually get merged into the official version and posted on nuget!. Thanks for the library, it was really helpful and sorry to bother you :)

Alecu100 commented 2 months ago

@gmamaladze Hello there! Is this project still maintained?