Hotkeys API Reference
- HotkeyManager
- getHotkeyManager
- Hotkey
- HotkeyChord
- HotkeySequence
- RegisterableHotkey
- RegisterableHotkeyChord
- RegisterableHotkeySequence
- RawHotkeyChord
- HotkeyOptions
- HotkeyChordOptions
- HotkeySequenceOptions
- HotkeyOptionsFor
- HotkeyRegistrationHandle
- HotkeyRegistrationView
- HotkeyChordRegistrationView
- HotkeySequenceRegistrationView
- toHotkeyRegistrationView
- HotkeyCallback
- HotkeyCallbackContext
- HotkeyChordCallbackContext
- HotkeySequenceCallbackContext
- HotkeyCallbackContextFor
- HotkeyMeta
- ConflictBehavior
- isHotkeySequence
- simplifyHotkey
- createSequenceMatcher
- DEFAULT_SEQUENCE_TIMEOUT
- createHotkeysScope
- useHotkeyRegistrations
- onHotkey
- onHotkeys
- useHotkey
- useHotkeys
- DefaultHotkeysOptions
- EmberHotkeysScope
- EmberHotkeyState
- HotkeyRegistrationsResult
- ElementHotkeyOptions
- EmberHotkeyCommonOptions
- EmberHotkeyDefinition
- EmberHotkeyTarget
- MaybeGetter
App Hotkeys API Reference
- defineAppHotkeys
- AppHotkeysStore
- provideAppHotkeys
- publishAppHotkeysStore
- AppHotkey
- AppHotkeyInput
- AppHotkeyOptions
- AppHotkeyListItem
- AppHotkeyStatus
- AppHotkeysState
- AppHotkeysStoreOptions
- CustomHotkeys
- Register
- AppHotkeyId
- RegisteredAppHotkeys
- isAppHotkey
- isCustomHotkey
- resolveAppHotkey
- useAppHotkeyList
- useAppHotkeys
- useCustomHotkeys
- EmberCustomHotkeys
- EmberAppHotkeyList
Key hold & held keys API Reference
Hotkey Recorder API Reference
- HotkeyRecorder
- HotkeyRecorderOptions
- HotkeyChordRecorderOptions
- HotkeySequenceRecorderOptions
- HotkeyRecorderState
- HotkeyRecorderCommitKeys
- HotkeyRecorderValidationContext
- HotkeyChordRecorderValidationContext
- HotkeySequenceRecorderValidationContext
- RecorderOptions
- RecorderRejection
- RecorderKeyMode
- findHotkeyConflicts
- HotkeyConflict
- HotkeyConflictOptions
- useHotkeyRecorder
- EmberHotkeyRecorder
Normalization & format API Reference
- formatForDisplay
- FormatDisplayOptions
- DisplayHotkey
- DisplayHotkeyChord
- formatHotkey
- normalizeHotkey
- parseHotkey
- parseKeyboardEvent
- ParsedHotkeyChord
- matchesKeyboardEvent
- areHotkeysEqual
- validateHotkey
- checkHotkey
- assertValidHotkey
- ValidationResult
- ValidatableHotkey
- LogicalKey
- PhysicalKey
- PhysicalKeyCode
- KEY_DISPLAY_SYMBOLS
- PUNCTUATION_KEY_DISPLAY_LABELS
- MAC_MODIFIER_SYMBOLS
- MAC_MODIFIER_LABELS
- WINDOWS_MODIFIER_LABELS
- LINUX_MODIFIER_LABELS
- MODIFIER_ALIASES
- MODIFIER_ORDER
- MODIFIER_KEYS
onHotkeys
Defined in: packages/ember-hotkeys/src/onHotkeys.ts:9
Attach a reactive list of hotkeys directly to an element.
Extends#
- default<{ Args: { Named: ElementHotkeyOptions; Positional: [ReadonlyArray<EmberHotkeyDefinition>]; }; Element: HTMLElement; }>
Constructors#
Constructor#
new onHotkeys(owner, args): OnHotkeys;Defined in: node_modules/.pnpm/ember-modifier@4.2.2_@babel+core@7.29.7_supports-color@8.1.1__supports-color@8.1.1/node_modules/ember-modifier/declarations/-private/class-based/modifier.d.ts:26
Parameters#
owner#
Owner
An instance of an Owner (for service injection etc.).
args#
ArgsFor<{ Args: { Named: ElementHotkeyOptions; Positional: [readonly EmberHotkeyDefinition[]]; }; Element: HTMLElement; }>
The positional and named arguments passed to the modifier.
Returns#
OnHotkeys
Inherited from#
Modifier<{
Element: HTMLElement
Args: {
Positional: [ReadonlyArray<EmberHotkeyDefinition>]
Named: ElementHotkeyOptions
}
}>.constructorProperties#
[Invoke]#
[Invoke]: (element, ...args) => ModifierReturn;Defined in: node_modules/.pnpm/@glint+template@1.9.0/node_modules/@glint/template/-private/integration.d.ts:22
Parameters#
element#
HTMLElement
args#
...[readonly EmberHotkeyDefinition[], NamedArgs<ElementHotkeyOptions>]
Returns#
ModifierReturn
Inherited from#
Modifier.[Invoke]Methods#
modify()#
modify(
element,
positional,
options): void;Defined in: packages/ember-hotkeys/src/onHotkeys.ts:18
Called when the modifier is installed and any time any tracked state used in the modifier changes.
If you need to do first-time-only setup, create a class field representing the initialization state and check it when running the hook. That is also where and when you should use registerDestructor for any teardown you need to do. For example:
function disconnect(instance) {
instance.observer?.disconnect();
}
class IntersectionObserver extends Modifier {
observer;
constructor(owner, args) {
super(owner, args);
registerDestructor(this, disconnect);
}
modify(element, callback, options) {
disconnect(this);
this.observer = new IntersectionObserver(callback, options);
this.observer.observe(element);
}
}Parameters#
element#
HTMLElement
The element to which the modifier is applied.
positional#
[readonly EmberHotkeyDefinition[]]
The positional arguments to the modifier.
options#
Returns#
void
Overrides#
Modifier.modify