RoanH / KeysPerSecond

A keys-per-second meter & counter. Written for osu! but should work for other rhythm games too.
https://osu.ppy.sh/forum/t/552405/
GNU General Public License v3.0
346 stars 28 forks source link

M1 Mac Support #39

Closed colourfullyy closed 3 years ago

colourfullyy commented 3 years ago

hi, when I try to start the .jar application from command line using java -jar KeysPerSecond-v8.4.jar, it opens without any gui and outputs this in the cmd and crashes: Ctrl + P: Causes the program to reset and print the average and maximum value Ctrl + U: Terminates the program Ctrl + I: Causes the program to reset and print the key press statistics Ctrl + Y: Hides/shows the GUI Ctrl + T: Pauses/resumes the counter Ctrl + R: Reloads the configuration Exception in thread "main" java.lang.UnsatisfiedLinkError: 'java.lang.Integer com.github.kwhat.jnativehook.GlobalScreen.getAutoRepeatRate()' at com.github.kwhat.jnativehook.GlobalScreen.getAutoRepeatRate(Native Method) at com.github.kwhat.jnativehook.GlobalScreen.(GlobalScreen.java:96) at me.roan.kps.Main.setupNativeHook(Main.java:350) at me.roan.kps.Main.main(Main.java:240) Exception in thread "Thread-0" java.lang.NoClassDefFoundError: Could not initialize class com.github.kwhat.jnativehook.GlobalScreen at me.roan.kps.Main$1.run(Main.java:232)

I'm not at all familiar with java so I would appreciate help

RoanH commented 3 years ago

Interesting issue, I would only expect such an exception when you are not running on a supported system. Which operating system and architecture are you running on?

colourfullyy commented 3 years ago

oh yes, forgot to mention that, I'm on an m1 mac running big sur 11.5.2

another issue could be that I'm using an arm jdk

RoanH commented 3 years ago

Ah, yeah unfortunately the library I am currently using to handle key input on Mac only supports 10.5 - 10.12. There is a feature request issue for M1 support, but it doesn't look like it will happen anytime soon. I myself do not own any Apple devices at all, so there's not much I can do since I cannot test anything. So for now waiting for the feature request I linked is the best I can do. There are technically some other things I could do but with a lack of ability to test and time I don't want to make any promises I can't keep.

kwhat commented 3 years ago

@RoanH M1 is now added as a target, I have no way of testing it so someone will need to check to see if it works.

@colourfullyy as for the original error, it is cased by not loading the appropriate JNI binary. I have no idea what KeysPerSecond-v8.4.jar is, but the jnativehook jar should load the binaries for you at runtime. Does this KeysPerSecond-v8.4.jar jar come with the jnativehook jar file? It sounds like you may just have a class path issue.

java -classpath c:\Path\To\JNativeHook.jar -jar KeysPerSecond-v8.4.jar will probably get things running.

RoanH commented 3 years ago

@kwhat Thanks a lot! I have a friend who might own an M1 Mac. I'll ask him if he would be willing to give this a try. He didn't buy one yet.

@colourfullyy I've also compiled a test version with the jnativehook update, it would be great if you (or anyone else with an M1 Mac) could test this: https://share.roanh.dev/KeysPerSecond-v8.4-M1.jar

colourfullyy commented 3 years ago

Hi, I tried the m1 jar and it works flawlessly with an arm jdk. However it can't seem to overlay on full screened windows.

RoanH commented 3 years ago

That's great news! @kwhat seems like M1 support works as intended, thanks again.

As for overlaying applications running in exclusive full screen mode, this is tracked in #28. But this is not something I foresee being implemented in the near future. M1 support will be part of the next release (v8.5) and you can use the M1 jar in the meantime.

kwhat commented 3 years ago

Awesome, thanks for testing.

On Fri, Sep 17, 2021, 6:06 PM Roan @.***> wrote:

That's great news! @kwhat https://github.com/kwhat seems like M1 support works as intended, thanks again.

As for overlaying applications running in exclusive full screen mode, this is tracked in #28 https://github.com/RoanH/KeysPerSecond/issues/28. But this is not something I foresee being implemented in the near future. M1 support will be part of the next release (v8.5) and you can use the M1 jar in the meantime.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RoanH/KeysPerSecond/issues/39#issuecomment-922152278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFFCRDPCYVDF6PJGZAH6WDUCPQZ7ANCNFSM5DS4HULA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.