Skip to content

Commit

Permalink
Fix PlayStation button reference
Browse files Browse the repository at this point in the history
Closes #30.
  • Loading branch information
domenic committed May 22, 2024
1 parent e1b08d4 commit aa01bc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ Note that the line between "UI state" and "a navigation" can be blurry in single

If we assume that developers already know to handle the <kbd>Esc</kbd> key to close their components, then we could potentially translate other close requests, like the Android back button, into <kbd>Esc</kbd> key presses. The hope is then that application and component developers wouldn't have to update their code at all: if they're doing the right thing for that common desktop close request, they would suddenly start doing the right thing on other platforms as well. This is especially attractive as it could help avoid the awkward transition period mentioned in the [goals](#goals) section.

However, upon reflection, such a solution doesn't really solve the general problem. Given an Android back button press, or a PlayStation square button press, or any other gesture which might serve multiple context-dependent purposes, the browser needs to know: should perform its usual action, or should it be translated to an <kbd>Esc</kbd> key press? For custom components, the only way to know is for the web developer to tell the browser that a close-request-consuming component is open. So our goal of requiring no code modifications, or awkward transition period, is impossible. We'd still need some API, a counterpart to our `new CloseWatcher()`, which tells the browser that the next close request should be turned into an <kbd>Esc</kbd> keypress. Given this, the strangeness of synthesizing fake <kbd>Esc</kbd> key presses in response to some other setup API does not have much to recommend it.
However, upon reflection, such a solution doesn't really solve the general problem. Given an Android back button press, or a PlayStation circle button press, or any other gesture which might serve multiple context-dependent purposes, the browser needs to know: should perform its usual action, or should it be translated to an <kbd>Esc</kbd> key press? For custom components, the only way to know is for the web developer to tell the browser that a close-request-consuming component is open. So our goal of requiring no code modifications, or awkward transition period, is impossible. We'd still need some API, a counterpart to our `new CloseWatcher()`, which tells the browser that the next close request should be turned into an <kbd>Esc</kbd> keypress. Given this, the strangeness of synthesizing fake <kbd>Esc</kbd> key presses in response to some other setup API does not have much to recommend it.

### A single event

Expand Down

0 comments on commit aa01bc7

Please sign in to comment.