Moving keyboard focus between the Blockly workspace and the runtime environment for generated code #49
Replies: 4 comments 2 replies
-
If navigating via up/down/left/right, I think the intutive thing would be that an attempt to navigate beyond the boundary of the current contents of the workspace would move focus to other parts of the app (including the workspace)—but for this to feel seamless it would probably necessitate the rest of the app implementing a very similar navigation strategy, which might be exceedingly tricky in many cases. Treating a workspace as a single focusable element and allowing tab and shift-tab to enter/exit the workspace in the normal way might be the most generally compatible approach. (Flyout workspaces could be separate entities and so be accessed via tab / shift-tab as well, or they could be treated as sub-parts of the main workspace and accessed via a separate key binding like T-for-toolbox.) |
Beta Was this translation helpful? Give feedback.
-
Somewhat orthogonally to the question about how focus is moved: I think we should ensure that the cursor is only shown in the workspace when the workspace has focus, so that one's current location is always clear when navigating between the page (browser current location indicator) and workspace (cursor indicator). Suggestion in response to this comment from external testers:
|
Beta Was this translation helpful? Give feedback.
-
I agree that arrow navigation should be context dependent - it should only work if you are "in" the workspace / toolbox / flyout. I think it would be quite reasonable for the different workspaces to be separate focusable elements, which you tab between to enter/exit, as @cpcallen suggests. I think this approach is independent of whether tab is used at all inside workspaces as per #63. |
Beta Was this translation helpful? Give feedback.
-
A follow up from this one - what are the current arguments for requiring an "Enter" action on the workspace? If we aren't using Tab within the code editor (or at least - not loads of tab stops), what's stopping us from just requiring focus to use keyboard shortcuts on the editor, rather than focus + "some action to enter" ? And then you just Tab away from it if you need to go somewhere else, and the shortcuts are inactivated. I've been looking around at implementations of embedded rich text editors, and for those that care enough about accessibility to have published an accessibility statement / guidance page, it seems a common convention to just have keyboard shortcuts start working when the element is focused, but you don't have to press Enter to enter, and Tab still moves you on to the next element. e.g. CK Editor and Tiny MCE (the editor on this page is live). TinyMCE has a good page on screenreader access and shortcuts. Fwiw that also demonstrates the use of toolbars which use Tab internally but require a shortcut key to jump to, i.e. they don't pollute the main tab order. (@microbit-lucy for visibility) |
Beta Was this translation helpful? Give feedback.
-
Most blockly-based applications have a code workspace and a runtime.
Many of them expect interaction with the runtime: micro:bit has a simulator that can be clicked and tilted, code.org has clicking in flappy bird, and so on.
That means we need to have a standard way to move between the workspace and the runtime, since we don't want keypresses aimed at (e.g.) playing a game in the runtime to actually move blocks around in the blockly workspace.
Beta Was this translation helpful? Give feedback.
All reactions