mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-26 19:15:25 +03:00
HotKey names
Add an enum of key names for hot keys of interest - Use the key names in the `on` function
This commit is contained in:
parent
31eeb9f32b
commit
790824886d
@ -4,6 +4,21 @@ interface KeybindDefinitions {
|
||||
[combo: string]: (event: KeyboardEvent) => void;
|
||||
}
|
||||
|
||||
export enum KeyName {
|
||||
Space = ' ',
|
||||
Meta = 'Meta',
|
||||
Alt = 'Alt',
|
||||
Ctrl = 'Ctrl',
|
||||
Enter = 'Enter',
|
||||
Escape = 'Escape',
|
||||
Tab = 'Tab',
|
||||
Up = 'ArrowUp',
|
||||
Down = 'ArrowDown',
|
||||
Left = 'ArrowLeft',
|
||||
Right = 'ArrowRight',
|
||||
Delete = 'Backspace'
|
||||
}
|
||||
|
||||
export function createKeybind(keybinds: KeybindDefinitions) {
|
||||
const keys: KeybindDefinitions = {
|
||||
// Ignore backspace keydown events always
|
||||
|
Loading…
Reference in New Issue
Block a user