-
Notifications
You must be signed in to change notification settings - Fork 237
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
AltGr doesn't work #89
Comments
Hi Rene, does this work with a regular TextArea from JavaFX? |
Hey Tomas! |
Hi Rene, I just tested it and it works for me in the provided RichTextFX demos (e.g. JavaKeywords), using JDK 8u20 on Linux. What platform are you on? |
I tried it on Windows and Linux, both have the german keyboard layout enabled. On the Windows machine it doesn't work, on Linux I don't have any problems with the demo. |
I did some testing.
As you can see control, alt and shortcut is beeing pressed. In I hope I was able to help identifying the cause of the problem. Looking forward to a fix :) |
Hi Rene, sorry for the delay. I cannot test it on Windows right now. The event you report is of type I think you correctly identified where the event is blocked. However, your suggested fix (removing the checks for control keys) would mean that, for example, Ctrl+Z would produce the character 'Z' in addition to "Undoing" the last action, which is not desirable. Anyway, if it works correctly in TextArea, we can make it work in RichTextFX, we just have to figure out how. |
I checked the KeyTyped Event:
I tried out some key combinations like Ctrl+Z and did not had a problem with writing for example a Z. The fix was more like a quick and dirty lets see if it works kind off fix :D. If you need any more testing, I will gladly help you! |
You are right, after removing the checks, Ctrl+Z does not produce 'Z'—it is prevented at this line
because Ctrl+Z produces KEY_TYPED event with the character 0x1A, which is a control character and is filtered out by the However, Shift+Ctrl+Z does type 'Z' in addition to "Redo" (the KEY_TYPED event that is produced does contain the character 'Z'). |
Interesting. I also tried the |
So there really is a difference in what events and characters are produced between Windows and Linux. It doesn't seem to be resolvable in a platform independent manner. This is the relevant code in JavaFX to handle this (copied from // Filter out control keys except control+Alt on PC or Alt on Mac
if (event.isControlDown() || event.isAltDown() || (isMac() && event.isMetaDown())) {
if (!((event.isControlDown() || isMac()) && event.isAltDown())) return;
} |
Can you please sanity test the behavior of my latest commit on Windows? |
It seems to work now! Thanks! |
Thanks for your help. I made a 0.5.1 release that includes this fix. |
The AltGr Key to modify a keys behaviour doesn't print any characters. For example 8+AltGr should lead to a [ printed, but it does just nothing. The AltGr Key is used on German keyboards. I don't know about the other layouts out there.
Edit: Using RichTextFX 0.5 on JDK 8 Update 20
The text was updated successfully, but these errors were encountered: