ui/kbd.js file

FocusGuard

Install a FocusGuard to allow only a restricted set of elements to get focus.

Constants

kbd_modifiers
Keyboard modifiers used for hotkeys.
KeyCode
Symbolic names for key codes

Functions

display_keyname (keyname)
Create display name from KeyEvent.code names.
hotkey_name_from_event (event)
Create hotkey name from KeyboardEvent.
match_key_event (event, keyname)
Match an event's key code, considering modifiers.
is_navigation_key_code (keycode)
Check if a key code is used of rnavigaiton (and non alphanumeric).
activeElement ()
Get the currently focussed Element, also inspecting open shadowRoot hierarchies.
list_focusables (element)
List elements that can take focus including shadow DOMs and are descendants of element or the document
push_focus_root (element, escapecb)
Constrain focus to element and its descendants
remove_focus_root (element)
Remove an element previously installed via push_focus_root()
element_rect (element)
Compute element rectangle, e.g. for focus movement
keydown_move_focus (event)
Move focus on UP/DOWN/HOME/END keydown events
move_focus (dir, subfocus)
Move focus to prev or next focus widget
forget_focus (element)
Forget the last focus element inside element
hotkey_handler (event)
Global key handler to dispatch key events according to global keymaps.
add_hotkey (hotkey, callback, subtree_element)
Add a global hotkey handler.
remove_hotkey (hotkey, callback)
Remove a global hotkey handler.
add_key_filter (keycode, callback)
Add a global keymap.
remove_key_filter (keycode)
Remove a global keymap.
add_keymap (keymap)
Add a global keymap.
remove_keymap (keymap)
Remove a global keymap.
is_button_input (element)
Check if element is button-like input
is_nav_input (element)
Check if element has inner input navigation
shortcut_lookup (mapname, label, shortcut)
Lookup shortcut for label in mapname, default to shortcut
shortcut_dialog (mapname, label, shortcut)
Display shortcut editing dialog