Class: KeyboardNavigationController
Defined in: packages/blockly/core/keyboard_navigation_controller.ts:15
The KeyboardNavigationController handles coordinating Blockly-wide keyboard navigation behavior, such as enabling/disabling full cursor visualization.
Methods index
| Method | Description |
|---|---|
| setIsActive | Sets whether a user is actively using keyboard navigation. |
| getIsActive | Returns true if the user is actively using keyboard navigation (e.g., has recently taken some action that is only relevant to keyboard users) |
| setScopeChangeAudioCuesEnabled | Sets whether or not audio cues should be played when keyboard navigation transitions between blocks of different nesting levels. |
| getScopeChangeAudioCuesEnabled | Returns whether or not audio cues should be played when keyboard navigation transitions between blocks of different nesting levels. |
Constructors
Constructor
new KeyboardNavigationController(): KeyboardNavigationController;
Returns
KeyboardNavigationController
Methods
setIsActive()
setIsActive(isUsing?): void;
Defined in: packages/blockly/core/keyboard_navigation_controller.ts:44
Sets whether a user is actively using keyboard navigation.
If they are, apply a css class to the entire page so that focused items can apply additional styling for keyboard users.
Note that since enabling keyboard navigation presents significant UX changes (such as cursor visualization and move mode), callers should take care to only set active keyboard navigation when they have a high confidence in that being the correct state. In general, in any given mouse or key input situation callers can choose one of three paths:
- Do nothing. This should be the choice for neutral actions that don't predominantly imply keyboard or mouse usage (such as clicking to select a block).
- Disable keyboard navigation. This is the best choice when a user is definitely predominantly using the mouse (such as using a right click to open the context menu).
- Enable keyboard navigation. This is the best choice when there's high confidence a user actually intends to use it (such as attempting to use the arrow keys to move around).
Parameters
| Parameter | Type | Default value |
|---|---|---|
isUsing | boolean | true |
Returns
void
getIsActive()
getIsActive(): boolean;
Defined in: packages/blockly/core/keyboard_navigation_controller.ts:53
Returns
boolean
true if the user is actively using keyboard navigation (e.g., has recently taken some action that is only relevant to keyboard users)
setScopeChangeAudioCuesEnabled()
setScopeChangeAudioCuesEnabled(enabled): void;
Defined in: packages/blockly/core/keyboard_navigation_controller.ts:61
Sets whether or not audio cues should be played when keyboard navigation transitions between blocks of different nesting levels.
Parameters
| Parameter | Type |
|---|---|
enabled | boolean |
Returns
void
getScopeChangeAudioCuesEnabled()
getScopeChangeAudioCuesEnabled(): boolean;
Defined in: packages/blockly/core/keyboard_navigation_controller.ts:69
Returns whether or not audio cues should be played when keyboard navigation transitions between blocks of different nesting levels.
Returns
boolean