kwhat / jnativehook

Global keyboard and mouse listeners for Java.
Other
1.75k stars 347 forks source link

Don't know if this is fixable, but still a bug #435

Closed CreativityAtItsBest closed 1 year ago

CreativityAtItsBest commented 1 year ago

If I enter a game such as Genshin Impact, it can no longer detect any mouse presses, key presses, or mouse movements. This is also an issue in the normal non-native java robots. If i make it wait 5 seconds and press a key it won't work in some applications.

is there any way to get around this limitation?

kwhat commented 1 year ago

no longer

This implies that it use to work and that it no longer works. Since the library has not chanced, I presume something else did.

is there any way to get around this limitation?

I don't even know what platform you are using this on. I will assume windows since Genshin Impact is a native Windows game and is not supported by Steam. I also assume the issue your having is sending events not receiving them?

Microsoft has slowly been introducing User Interface Privilege Isolation which the posting events are subject to. This isn't really a bug and the only way to work around the limitation is to try and run your program as Administrator and see if that helps. Apple has a much better approach to application privilege management where the User can grant apps access to do this sort of stuff. Windows does not and only recently started trying to lock this sort of stuff down.

I have no idea if this is the problem you are facing and I don't have any where near enough information to help you further. This library was originally created to run in non-privileged mode so any fix that requires admin access is not going to make it in. Any hacks to work around OS security are also out of scope.