Class: KeyboardCommandsModal
keyboard/KeyboardCommandsModal.KeyboardCommandsModal
Defines a mode to use with a modal version of Cursorless keyboard.
Constructors
constructor
• new KeyboardCommandsModal(graph)
Parameters
| Name | Type |
|---|---|
graph | Graph |
Defined in
keyboard/KeyboardCommandsModal.ts:38
Properties
inputDisposable
• Private inputDisposable: undefined | Disposable
This disposable is returned by KeyboardHandler.pushListener, and is used to relinquich control of the keyboard. If this disposable is non-null, then our mode is active.
Defined in
keyboard/KeyboardCommandsModal.ts:30
mergedKeymap
• Private mergedKeymap: Record<string, KeyHandler<any>>
Merged map from all the different sections of the key map (eg actions, colors, etc).
Defined in
keyboard/KeyboardCommandsModal.ts:36
Methods
constructMergedKeymap
▸ Private constructMergedKeymap(): void
Returns
void
Defined in
keyboard/KeyboardCommandsModal.ts:72
getConflictingKeyMapEntry
▸ getConflictingKeyMapEntry(text): undefined | KeyHandler<any>
This function can be used to deterct if a proposed map entry conflicts with one in the map. Used to detect if the user tries to use two map entries, one of which is a prefix of the other.
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The proposed new map entry |
Returns
undefined | KeyHandler<any>
The first map entry that conflicts with {@link text}, if one exists
Defined in
keyboard/KeyboardCommandsModal.ts:223
handleInput
▸ handleInput(text): Promise<void>
Parameters
| Name | Type |
|---|---|
text | string |
Returns
Promise<void>
Defined in
keyboard/KeyboardCommandsModal.ts:180
handleSection
▸ Private handleSection<T>(sectionName, defaultKeyMap, handleValue): void
Adds a section (eg actions, scopes, etc) to the merged keymap.
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
sectionName | SectionName | The name of the section (eg "actions", "scopes", etc) |
defaultKeyMap | Keymap<T> | The default values for this keymap |
handleValue | (value: T) => Promise<unknown> | The function to call when the user presses the given key |
Returns
void
Defined in
keyboard/KeyboardCommandsModal.ts:102
init
▸ init(): void
Returns
void
Defined in
keyboard/KeyboardCommandsModal.ts:46
isModeOn
▸ Private isModeOn(): boolean
Returns
boolean
Defined in
keyboard/KeyboardCommandsModal.ts:176
isPrefixOfKey
▸ isPrefixOfKey(text): boolean
Parameters
| Name | Type |
|---|---|
text | string |
Returns
boolean
Defined in
keyboard/KeyboardCommandsModal.ts:211
modeOff
▸ modeOff(): Promise<void>
Returns
Promise<void>
Defined in
keyboard/KeyboardCommandsModal.ts:156
modeOn
▸ modeOn(): Promise<void>
Returns
Promise<void>
Defined in
keyboard/KeyboardCommandsModal.ts:136
modeToggle
▸ modeToggle(): void
Returns
void
Defined in
keyboard/KeyboardCommandsModal.ts:168