KeyBinding
Represents a keyboard shortcut binding that triggers when a specific key combination is pressed.
KeyBinding monitors keyboard input and triggers an event when its assigned key combination is activated. It supports modifier keys (Shift, Cmd/Ctrl) combined with regular keys, and handles platform-specific differences (e.g., Cmd on macOS vs Ctrl on Windows/Linux).
Note: KeyBinding instances are typically created and managed by KeyBindings, not instantiated directly.
Instance Members
accelerator: ReadOnlyArray<Anonymous>
The key combination that triggers this binding. Read-only array of KeyAcceleratorItem elements that must all be pressed together.
bindings: KeyBindings
The parent KeyBindings instance that manages this binding. Null if this binding is not part of a KeyBindings collection.
Private Members
matches: Bool
leftShiftPressed: Bool
rightShiftPressed: Bool
disableIfShiftPressed: Bool
emitTrigger(): Void
Triggered when the key combination is pressed. The event fires once when all keys in the combination are pressed together. @event trigger
bindKeyboardEvents(): Void
Name | Type |
---|---|
scanCode |
ScanCode |
itemIndex |
Int |
Name | Type |
---|---|
keyCode |
KeyCode |
itemIndex |
Int |
bindShift(): Void
checkStatus(): Void
new(accelerator: Array<Anonymous>, ?bindings: KeyBindings): Void
Name | Type | Default |
---|---|---|
accelerator |
Array |
|
bindings |
KeyBindings | (optional) |
Metadata
Name | Parameters |
---|---|
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:allow |
ceramic.KeyBindings |