kwhat / jnativehook

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

Mouse and keyboard events are not being captured. #400

Open dipeshji opened 2 years ago

dipeshji commented 2 years ago

On mac M1 architecture mouse and keyboard events are not being captured.

kwhat commented 2 years ago

You are going to have to provide more information than it does not work. From what I've been told, 2.2.1 works fine on the M1. Please provide debug level log output illustrating the problem. I suspect you have not enabled access for accessibility devices.

dipeshji commented 2 years ago

Can you please let me know what access permissions are required in M1?

dipeshji commented 2 years ago

Are you talking about this dependency? `

com.github.kwhat
        <artifactId>jnativehook</artifactId>
        <version>2.2.1</version>
    </dependency>`
kwhat commented 2 years ago

Are you talking about this dependency?

Yes, that should work fine with an M1 mac but I have no way of testing it. Check your console logs for errors, something else maybe wrong.

dipeshji commented 2 years ago

I'm not getting any error, but also it's not capturing the events. I think their might be some issues with permissions. So can you please let me know the required permissions?

dipeshji commented 2 years ago

Attached screenshots of accessibility permissions. MicrosoftTeams-image (2) MicrosoftTeams-image (1) .

kwhat commented 2 years ago

You called GlobalScreen.registerNativeHook() right? Did you test running the jar from the terminal?

dipeshpatidar commented 2 years ago

While running the jar, i got the error Error: Unable to initialize main class com.fourtysevenbillion.timesheet.Timesheet Caused by: java.lang.NoClassDefFoundError: com/github/kwhat/jnativehook/NativeHookException