Stay organized with collections
Save and categorize content based on your preferences.
blockly > KeyboardNavigationController
KeyboardNavigationController class
The KeyboardNavigationController handles coordinating Blockly-wide keyboard navigation behavior, such as enabling/disabling full cursor visualization.
Signature:
export declare class KeyboardNavigationController
Methods
Method |
Modifiers |
Description |
getIsActive() |
|
|
setIsActive(isUsing) |
|
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: 1. 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). 2. 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). 3. 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). |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-24 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-24 UTC."],[],[],null,["[blockly](./blockly.md) \\\u003e [KeyboardNavigationController](./blockly.keyboardnavigationcontroller_class.md)\n\nKeyboardNavigationController class\n----------------------------------\n\nThe KeyboardNavigationController handles coordinating Blockly-wide keyboard navigation behavior, such as enabling/disabling full cursor visualization.\n\n**Signature:** \n\n export declare class KeyboardNavigationController \n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|----------------------------------------------------------------------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [getIsActive()](./blockly.keyboardnavigationcontroller_class.getisactive_1_method.md) | | |\n| [setIsActive(isUsing)](./blockly.keyboardnavigationcontroller_class.setisactive_1_method.md) | | 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: 1. 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). 2. 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). 3. 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). |"]]