glkote icon indicating copy to clipboard operation
glkote copied to clipboard

Escape key works inconsistently between Safari and Chrome

Open erkyrath opened this issue 2 years ago • 3 comments

Noted in this thread: https://intfiction.org/t/release-along-with-parchment-interpreter/61411/20

Testing in https://eblong.com/zarf/glulx/quixe/quixe/play-remote.html?story=stories/Advent.ulx.js : If the input focus is off the input line, hitting a normal key (e.g. space bar) refocuses and enters the key. Does escape do the same? Yes in Safari, no in Chrome.

Same problem with the delete key, now that I check.

This becomes noticeable in keystroke input. (Type HELP for example.) Hitting escape should quit the help menu, but this breaks in Chrome if the input focus has come loose. It's a little shaky even in Safari, where you may have to hit escape twice.

erkyrath avatar Apr 05 '23 19:04 erkyrath

GlkOte only has a keypress document handler, so it's not going to be able to detect non-character keys!

Also, after focusing you may have to retrigger keydown events. Here's how I did it in AsyncGlk: https://github.com/curiousdannii/asyncglk/blob/073f4c49218e13b71ee19f8729a6dd81ee76c23d/src/glkote/web/windows.ts#L787

curiousdannii avatar Apr 06 '23 21:04 curiousdannii