diff options
author | Wyvest <wyvestbusiness@gmail.com> | 2024-01-20 11:29:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-20 11:29:57 -0500 |
commit | 0afab2cd1b1266034d35cd66f41c3bde90847f9e (patch) | |
tree | 54172a78823cf76761ab88e21d6d2c64d5b965c3 /packages/ui/src/keys.ts | |
parent | 55b593c4e6b90137995aee9a55ba2a86423cc7bd (diff) | |
parent | 55548a94b61ce7d1ca0ca8da69db7566f937cfeb (diff) | |
download | Nexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.tar.gz Nexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.tar.bz2 Nexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.zip |
Merge pull request #4 from Polyfrost/website/icon-fix
Diffstat (limited to 'packages/ui/src/keys.ts')
-rw-r--r-- | packages/ui/src/keys.ts | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/packages/ui/src/keys.ts b/packages/ui/src/keys.ts index 55940f9..bb8eaa4 100644 --- a/packages/ui/src/keys.ts +++ b/packages/ui/src/keys.ts @@ -1,3 +1,4 @@ +// https://www.w3.org/TR/uievents-key/#keys-modifier export enum ModifierKeys { Alt = 'Alt', Shift = 'Shift', @@ -10,14 +11,30 @@ export enum ModifierKeys { NumLock = 'NumLock', ScrollLock = 'ScrollLock', Symbol = 'Symbol', - SymbolLock = 'SymbolLock' + SymbolLock = 'SymbolLock', +} + +export enum EditingKeys { + Backspace = 'Backspace', + Delete = 'Delete', +} + +export enum UIKeys { + Escape = 'Escape', +} + +export enum NavigationKeys { + ArrowUp = 'ArrowUp', + ArrowDown = 'ArrowDown', + ArrowLeft = 'ArrowLeft', + ArrowRight = 'ArrowRight', } export type OSforKeys = 'macOS' | 'Windows' | 'Other'; export const modifierSymbols: Record< - ModifierKeys, - { macOS?: string; Windows?: string; Other: string } + ModifierKeys | EditingKeys | UIKeys | NavigationKeys, + { macOS?: string, Windows?: string, Other: string } > = { Alt: { macOS: '⌥', Other: 'Alt' }, AltGraph: { macOS: '⌥', Other: 'Alt' }, @@ -30,10 +47,17 @@ export const modifierSymbols: Record< ScrollLock: { macOS: '⤓', Other: 'ScrLk' }, Shift: { Other: 'Shift', macOS: '⇧' }, Symbol: { macOS: '⎄', Other: 'Sym' }, - SymbolLock: { macOS: '⎄', Other: 'Sym' } + SymbolLock: { macOS: '⎄', Other: 'Sym' }, + Escape: { macOS: '⎋', Other: 'Esc' }, + Delete: { macOS: '⌦', Other: 'Del' }, + Backspace: { macOS: '⌫', Other: '⟵' }, + ArrowUp: { Other: '↑' }, + ArrowDown: { Other: '↓' }, + ArrowLeft: { Other: '←' }, + ArrowRight: { Other: '→' }, }; -export const keySymbols: Record<string, { macOS?: string; Windows?: string; Other: string }> = { +export const keySymbols: Record<string, { macOS?: string, Windows?: string, Other: string }> = { ' ': { Other: '␣' }, 'Tab': { macOS: '⇥', Other: '⭾' }, 'Enter': { macOS: '↩', Other: '↵' }, @@ -52,5 +76,5 @@ export const keySymbols: Record<string, { macOS?: string; Windows?: string; Othe 'Shift': { macOS: '⇧', Other: 'Shift' }, 'PrintScreen': { Other: 'PrtSc' }, 'ScrollLock': { macOS: '⤓', Other: 'ScrLk' }, - 'Pause': { macOS: '⎉', Other: 'Pause' } + 'Pause': { macOS: '⎉', Other: 'Pause' }, }; |