Skip to content

Fix handling of keys that are browser shortcuts - #147

Merged
jmmv merged 1 commit into
masterfrom
issue-136
Dec 9, 2021
Merged

jmmv merged 1 commit into
masterfrom
issue-136

Conversation

@jmmv

@jmmv jmmv commented Dec 8, 2021

Copy link
Copy Markdown
Collaborator

There are a bunch of key presses that should be recognized by EndBASIC
but that are also recognized by the browser. Some include the Tab key,
the arrow keys (when "caret browsing" is enabled), and the slash key
in Firefox.

Before, pressing any of these keys would cause the browser to also
perform their default action, which meant that the REPL would misbehave
by losing focus or triggering links. With this change, we prevent the
events from propagating to the browser once we have handled them so
that this problem doesn't surface.

This change is inspired by the fix submitted by @Protowalker in #140.

Fixes #136.

@jmmv
jmmv force-pushed the issue-136 branch 2 times, most recently from bac9ced to e6cb33f Compare December 8, 2021 17:48
There are a bunch of key presses that should be recognized by EndBASIC
but that are also recognized by the browser.  Some include the Tab key,
the arrow keys (when "caret browsing" is enabled), and the slash key
in Firefox.

Before, pressing any of these keys would cause the browser to also
perform their default action, which meant that the REPL would misbehave
by losing focus or triggering links.  With this change, we prevent the
events from propagating to the browser once we have handled them so
that this problem doesn't surface.

Manually tested this on an iPad and on an Android emulator and there
don't seem to be regressions with the previous behavior.

This change is inspired by the fix submitted by @Protowalker in #140.

Fixes #136.
@jmmv
jmmv merged commit 29f4bed into master Dec 9, 2021
@jmmv
jmmv deleted the issue-136 branch December 9, 2021 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Various keys escape the terminal

1 participant