feat: keyboard shortcuts for primary actions (#2030)
This commit is contained in:
20
packages/ui-services/src/Keyboard/KeyboardShortcut.ts
Normal file
20
packages/ui-services/src/Keyboard/KeyboardShortcut.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Platform } from '@standardnotes/snjs'
|
||||
import { KeyboardCommand } from './KeyboardCommands'
|
||||
import { KeyboardKey } from './KeyboardKey'
|
||||
import { KeyboardModifier } from './KeyboardModifier'
|
||||
|
||||
export type KeyboardShortcut = {
|
||||
command: KeyboardCommand
|
||||
modifiers?: KeyboardModifier[]
|
||||
key?: KeyboardKey | string
|
||||
/**
|
||||
* Alternative to using key, if the key can be affected by alt + shift. For example, if you want alt + shift + n,
|
||||
* use code 'KeyN' instead of key 'n', as the modifiers would turn n into '˜' on Mac.
|
||||
*/
|
||||
code?: string
|
||||
preventDefault?: boolean
|
||||
}
|
||||
|
||||
export type PlatformedKeyboardShortcut = KeyboardShortcut & {
|
||||
platform: Platform
|
||||
}
|
||||
Reference in New Issue
Block a user