Open davantwillert opened 2 years ago
Exact same problem here. (MacOS BigSur), also with U.S. International keyboard. Currently I get around by adding a U.S. keyboard. With this I can program with single and double quotes again :)
Yikes, sounds like a Java bug—may be fixed with the updated JDK that will be in 4.0 beta 3.
But if anyone can test/look into it further, that'd be really helpful—I don't have an International Keyboard to test with, unfortunately.
I had a quick look at this.
To reproduce this issue, it is not necessary to have an international keyboard. It is enough to add it as one of the keyboards/languages in settings. Then, right-clicking on the language symbol in the top right, select 'Show Keyboard Viewer'. This will display the international keyboard:
The problematic characters are the ones that are highlighted in orange. They are called dead keys (a modifier key pressed with another key to enter a letter with a diacritical mark). With international keyboard selected, just press the single quote mark and compare to behavior in TextEdit. Processing ignores the key press whereas a single quote appears in TextEdit (the complication is that depending on the next button press, it's necessarily to display either quote (if space is pressed) or a modified character - if ' and then 'a' is typed, the character becomes á).
I noticed that when a 'normal' key is pressed (quote on non-international keyboard), 3 events are triggered (key pressed, key typed and key released). Typing quote with international keyboard only seems to generate a key released event.
Thanks for looking into it, that's really helpful.
Was able to reproduce the problem here, and it comes down to how the events are passed to Processing. As a workaround, go to Preferences and check the "Enable complex text input" box, which is just a shorthand for enabling these multi-stroke key events (more commonly seen in non-Roman languages).
So it'll still need a fix—I'd like to see whether we can leave that turned on all the time, for instance—but hopefully this can get things working for you in the meantime.
I would like to type single and double quotes instead of having to copy/past the characters
Expected Behavior
I expect to see a " and ' character when I type it as happens in Word, this browser and all other applications
Current Behavior
When I type a single or double quote on an international keyboard (so with a space after the character), only the space appears
Steps to Reproduce
Your Environment
Possible Causes / Solutions