benfry / processing4

Processing 4.x releases for Java 17
https://processing.org
Other
1.34k stars 240 forks source link

Editor shortcuts using option break after changing Keyboard Preferences #404

Open infovore opened 2 years ago

infovore commented 2 years ago

Description

On Mac OS (tested on: 10.15.x), option-based editor motions (option-cursor left/right for "jump by word"; option-backspace for "delete word") do not work at all in the IDE. Command-based motions (ie, beginning of line / end of line) work just fine.

This is highly frustrating from a muscle memory point of view, and is a regression from 3.x.

See also issue #140.

Expected Behavior

Option-left and option-right should jump cursor by word in the IDE; option-backspace should delete word to left of cursor.

Current Behavior

Option-left, option-right, option-backspace do nothing (they are swallowed).

Steps to Reproduce

  1. Open the editor on a mac.
  2. Write some code.
  3. Try to move around it using option-left, option-right, or delete word to the left with option-backspace.

Your Environment

Processing 4.0b5, Mac OS 10.15.7

benfry commented 2 years ago

A third of my time developing this is on 10.15, and I've never been able to reproduce this. So is there anything else you have installed that could be causing trouble? Something that handles key shortcuts? Does it start working if you quit and restart Processing? (Or if not, reboot your machine?) Anything else I can go on, like whether you're on a non-US keyboard or version of macOS?

infovore commented 2 years ago

Hi, Ben -

thanks for the response. A bit more detective work at this end and I think I've got a diagnosis:

So: I'm retitling this issue to be more accurate, now I know what's up. This feels like something has changed in the way the external keyboard inside the editor is handled, possibly just down to Java changes; P3.5.4 handles non-default key layouts appropriately.

benfry commented 2 years ago

Ouch, ok… so this sounds like something outside our control, i.e. it may just be a bug in Java 17. The next release (beta 6) will use 17.0.2 which may even fix the issue.

Thanks for looking into it further! I'll keep an eye out.

infovore commented 2 years ago

Yep, feel like it might just be an issue inside Swing or something. I will keep an eye out for beta 6 and run this test again then!