mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-21 21:32:13 +01:00
Custom keybind commands (#574)
* added custom keybindings * removed logs
This commit is contained in:
parent
d923de412a
commit
bf447c60ce
@ -117,6 +117,10 @@ class KeybindManager {
|
||||
curKeybind.info = this.keyDescriptionsMap.get(curKeybind.command).info;
|
||||
}
|
||||
newKeyDescriptions.set(curKeybind.command, curKeybind);
|
||||
|
||||
if (this.isCustomCommand(curKeybind.command)) {
|
||||
this.registerKeybinding("app", "custom", curKeybind.command, null);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
let userError = `${curUserCommand} is invalid: error: ${e}`;
|
||||
@ -129,6 +133,14 @@ class KeybindManager {
|
||||
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 {
|
||||
let returnString = "";
|
||||
if (keyPress.mods.Cmd) {
|
||||
|
Loading…
Reference in New Issue
Block a user