ReferencePackages
@mwillbanks/tuil-hotkeys
Scoped terminal hotkeys, chords, and key sequences for tuil.
Overview
Scoped terminal hotkeys, chords, and key sequences for tuil.
@mwillbanks/tuil-hotkeys is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-hotkeysHow it operates
Hotkey bindings normalize terminal input, match chords and sequences, honor active scopes, resolve priorities, and dispose cleanly.
API
| API | Signature | Description |
|---|---|---|
Hotkey | function Hotkey | Public function Hotkey. |
HotkeyBinding | interface HotkeyBinding | Public interface HotkeyBinding. |
HotkeyConflict | interface HotkeyConflict | Public interface HotkeyConflict. |
HotkeyDispatchContext | interface HotkeyDispatchContext | Public interface HotkeyDispatchContext. |
HotkeyEvent | interface HotkeyEvent | Public interface HotkeyEvent. |
HotkeyLayer | function HotkeyLayer | Public function HotkeyLayer. |
HotkeyManager | class HotkeyManager | Public class HotkeyManager. |
HotkeyMetadata | interface HotkeyMetadata | Public interface HotkeyMetadata. |
HotkeyProvider | function HotkeyProvider | Public function HotkeyProvider. |
HotkeyScope | type HotkeyScope | Public type HotkeyScope. |
normalizeHotkeyNotation | function normalizeHotkeyNotation | Public function normalizeHotkeyNotation. |
normalizeTerminalKey | function normalizeTerminalKey | Public function normalizeTerminalKey. |
TerminalKey | interface TerminalKey | Public interface TerminalKey. |
useHotkey | function useHotkey | Public function useHotkey. |
useHotkeyManager | function useHotkeyManager | Public function useHotkeyManager. |
useHotkeys | function useHotkeys | Public function useHotkeys. |
Events and lifecycle
Bindings invoke handlers directly. Dispatch failures are routed to the caller-supplied error handler.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
hotkeys.register({ keys: "ctrl+s", scope: "application", handler: save });