-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command key can sometimes always be a modifier (mac) #48
Comments
What do you mean by "always a modifier on every key"? Is the modifier flag on but the key is not depressed? Does pressing and releasing the command key fix anything? I would try setting the logger to debug and see if anything useful comes out when the issue starts. It could be that the modifier is getting stuck because the hook restarted, but that should correct it self. The other possibility is there maybe memory corruption on the event object, but I cant figure out how its happening. The debug log level should give me a better idea of what is going on. |
Yes I mean that the modifier flag is on but the key is not depressed. I do not know if pressing and releasing the command key fixes everything. I will try the next time it happens. I have turned on debug logs, but of course I have not had it happen since then, if/when it does I will add the logs. Below is an example of the log files at WARNING level. The CaptureEvents is from my Application. This is essentially showing what information from the Event. INFO: Library extracted successfully: /var/folders/2z/6rnkzjzj2q55s6935mr329pc0000gp/T/libJNativeHook-2.0.0.dylib (0x14E29952E7A4EF4E15530C500082348FADEA1517). JNativeHook: Global keyboard and mouse hooking for Java. JNativeHook is free software: you can redistribute it and/or modify JNativeHook is distributed in the hope that it will be useful, You should have received a copy of the GNU Lesser General Public License Apr 06, 2015 8:32:00 AM java.lang.ClassLoader$NativeLibrary load Apr 06, 2015 8:32:00 AM java.lang.ClassLoader$NativeLibrary load Apr 06, 2015 8:32:00 AM java.lang.ClassLoader$NativeLibrary load Apr 06, 2015 8:32:00 AM java.lang.ClassLoader$NativeLibrary load Apr 06, 2015 8:32:00 AM java.lang.ClassLoader$NativeLibrary load Apr 06, 2015 8:32:00 AM java.lang.ClassLoader$NativeLibrary load 2015-32-06 08:32:39.276 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Pressed: (⇥) modifiers: [] Apr 06, 2015 8:32:45 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 8:32:45 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 8:32:45 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 8:32:45 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 8:32:45 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 8:32:45 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 8:32:45 AM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-32-06 08:32:45.565 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (275,88) modifiers: [⌘] From this point on all of the events have the modifier. |
I got it to happen again but I did not have a large enough buffer to capture the start of the modifier key being pressed (I have changed what I am capturing and will attempt to get that). Pressing the command key again, does seem to toggle off it always being selected. I am not sure if it helps but here are the logs from that happening: Apr 06, 2015 11:40:20 AM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-40-06 11:40:20.513 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (775,71) modifiers: [⌘] Apr 06, 2015 11:40:20 AM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-40-06 11:40:20.530 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (775,70) modifiers: [⌘] 2015-40-06 11:40:21.744 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Pressed: (Left Meta) modifiers: [⌘] Apr 06, 2015 11:40:21 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 11:40:22 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 11:40:22 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 11:40:22 AM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-40-06 11:40:22.248 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Pressed: (C) modifiers: [⌘] Apr 06, 2015 11:40:22 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 11:40:22 AM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 06, 2015 11:40:22 AM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-40-06 11:40:22.381 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Combination: image_10.png null (c) modifiers: [⌘] Apr 06, 2015 11:40:22 AM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-40-06 11:40:22.408 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Released: (C) modifiers: [] 2015-40-06 11:40:23.380 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (775,72) modifiers: [] |
Here are some logs showing what was happening when the command key was always down (this was done by holding the command key down before starting the listeners though this is not the only way this has happened). At the end I hit the command key again and it seems to stop the problem. Apr 07, 2015 3:16:37 PM org.jnativehook.DefaultLibraryLocator getLibraries JNativeHook: Global keyboard and mouse hooking for Java. JNativeHook is free software: you can redistribute it and/or modify JNativeHook is distributed in the hope that it will be useful, You should have received a copy of the GNU Lesser General Public License Apr 07, 2015 3:16:37 PM java.lang.ClassLoader$NativeLibrary load Apr 07, 2015 3:16:37 PM java.lang.ClassLoader$NativeLibrary load Apr 07, 2015 3:16:37 PM java.lang.ClassLoader$NativeLibrary load Apr 07, 2015 3:16:37 PM java.lang.ClassLoader$NativeLibrary load Apr 07, 2015 3:16:37 PM java.lang.ClassLoader$NativeLibrary load Apr 07, 2015 3:16:37 PM java.lang.ClassLoader$NativeLibrary load Apr 07, 2015 3:16:48 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:48 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:48 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:48 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:48 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:48 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:49 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:49 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:49 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:49 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:49.646 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Released: (Left Meta) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.208 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (775,39) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.225 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (775,40) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.241 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (775,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.286 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (774,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.304 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (773,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.323 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (770,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.338 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (765,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.355 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (758,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.371 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (747,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.389 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (735,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.405 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (721,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.422 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (711,42) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.439 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (698,40) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.456 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (687,39) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.473 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (678,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.490 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (669,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.506 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (664,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.523 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (660,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.540 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (654,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.557 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (649,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.575 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (644,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.592 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (640,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.610 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (637,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.626 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (635,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.644 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (633,38) modifiers: [⌘] Apr 07, 2015 3:16:51 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:51.661 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (632,38) modifiers: [⌘] Apr 07, 2015 3:16:52 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:52.062 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (632,39) modifiers: [⌘] Apr 07, 2015 3:16:52 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:52.079 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (632,40) modifiers: [⌘] Apr 07, 2015 3:16:52 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:52.097 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (632,42) modifiers: [⌘] Apr 07, 2015 3:16:52 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:52.114 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (632,43) modifiers: [⌘] Apr 07, 2015 3:16:52 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-16-07 15:16:52.141 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (632,44) modifiers: [⌘] 2015-16-07 15:16:52.591 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Mouse Moved: (632,45) modifiers: [⌘] Apr 07, 2015 3:17:00 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-17-07 15:17:00.524 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Pressed: (Left Meta) modifiers: [⌘] Apr 07, 2015 3:17:00 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:00 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:00 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-17-07 15:17:00.899 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Pressed: (C) modifiers: [⌘] Apr 07, 2015 3:17:00 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:01 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:01 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:01 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:01 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:01 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-17-07 15:17:01.171 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Combination: image_1.png null (c) modifiers: [⌘] 2015-17-07 15:17:04.196 DEBUG [JNativeHook Dispatch Thread] CaptureEvents Key Pressed: (Left Meta) modifiers: [⌘] Apr 07, 2015 3:17:04 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:04 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:04 PM org.jnativehook.GlobalScreen$NativeHookThread enable 2015-17-07 15:17:04.820 DEBUG [JNativeHook Dispatch Thread] AccessibilityAccess Removed all listeners Apr 07, 2015 3:17:04 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:04 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:04 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:05 PM org.jnativehook.GlobalScreen$NativeHookThread disable Apr 07, 2015 3:17:05 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:05 PM org.jnativehook.GlobalScreen$NativeHookThread enable Apr 07, 2015 3:17:05 PM org.jnativehook.GlobalScreen$NativeHookThread enable |
Have you tried with 2.0.1? I made a few api improvements on OS X. I haven't been able to duplicate the issue with 2.0 latest yet. |
I have tried it both with 2.0.1 and with the 2.0.20140406 build that you posted in another bug yesterday. In both cases I can get the bug to happen. While I have had it happen on other occasions, I can get it to happen fairly often by holding down the command key before the listeners are added and then releasing the command key after this time. |
Ahh ok, that makes sense. I have already addressed that issue on Windows but I have a feeling Apple is going to make it very difficult on OS X. I'll try to get a fix in sometime this week. |
Great! Let me know if you need anything else from me. I can easily test a build if you want as well. |
Git this nightly a try and see if it works better. I added the same Windows fix to OS X and Linux. |
I have done some limited testing on it and it appears to be fixed. Thanks! I will be testing it more today. I will let you know if there are any problems. |
The nightly, JNativeHook-2.0.20150418.jar, seems to work fine on OS X but I am having some problems with it on windows. (Not sure if was intended to work on windows ...) Every time I have run it, it always as something as a modifier, either the Mouse-2 button or shift key, similar to the way the command key was always down in OS X. |
Thanks for testing! It was suppose to work with Windows, but clearly I screwed something up ;) Ill put a new build together soon. |
Give this one a try. |
2.0.20150420 works for me on both OS-X and Windows. Thanks! |
NP, thanks again for testing. |
On Mac OS-X there are times when command key is always a modifier on every key and mouse event. It might not start on the first event, but once it starts it will stay as a modifier key on every event after that until the program ends. I have not been about to figure out what triggers it to start. It seems to happen about 10-20% of the time.
I have not seen this in the windows version.
This is in version 2.0.0.
The text was updated successfully, but these errors were encountered: