feat: keyboard shortcuts for primary actions (#2030)

This commit is contained in:
Mo
2022-11-18 09:01:48 -06:00
committed by GitHub
parent 0309912f98
commit f49ba6bd4d
67 changed files with 1296 additions and 555 deletions

View 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
}