mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
Custom keybind commands (#574)
* added custom keybindings * removed logs
This commit is contained in:
@@ -117,6 +117,10 @@ class KeybindManager {
|
|||||||
curKeybind.info = this.keyDescriptionsMap.get(curKeybind.command).info;
|
curKeybind.info = this.keyDescriptionsMap.get(curKeybind.command).info;
|
||||||
}
|
}
|
||||||
newKeyDescriptions.set(curKeybind.command, curKeybind);
|
newKeyDescriptions.set(curKeybind.command, curKeybind);
|
||||||
|
|
||||||
|
if (this.isCustomCommand(curKeybind.command)) {
|
||||||
|
this.registerKeybinding("app", "custom", curKeybind.command, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
let userError = `${curUserCommand} is invalid: error: ${e}`;
|
let userError = `${curUserCommand} is invalid: error: ${e}`;
|
||||||
@@ -129,6 +133,14 @@ class KeybindManager {
|
|||||||
this.keyDescriptionsMap = newKeyDescriptions;
|
this.keyDescriptionsMap = newKeyDescriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isCustomCommand(keyDescription: string): boolean {
|
||||||
|
let words = keyDescription.split(":");
|
||||||
|
if (words.length >= 2 && words[0] == "custom") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
prettyPrintKeyPress(keyPress: KeyPressDecl): string {
|
prettyPrintKeyPress(keyPress: KeyPressDecl): string {
|
||||||
let returnString = "";
|
let returnString = "";
|
||||||
if (keyPress.mods.Cmd) {
|
if (keyPress.mods.Cmd) {
|
||||||
|
|||||||
Reference in New Issue
Block a user