settings_panel: Bind vim keys to SettingsPanelMenu.

Added a commit to bind vim keys with the SettingsPanelMenu,
allowing users to control the settings and organization tabs
using 'h','j','k' and 'l' keys.

vim_left('h') -> Switch between tab by shifting focus to the left.
vim_right('l') -> Switch between tab by shifting focus to the right.
vim_up('k') -> Move up.
vim_down('j') -> Move down.
This commit is contained in:
aryanshridhar 2021-05-10 21:22:46 +05:30 committed by Tim Abbott
parent 67cd385cec
commit 9f9259683c
2 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,10 @@ const keys = {
38: "up_arrow",
39: "right_arrow",
40: "down_arrow",
72: "vim_left",
74: "vim_down",
75: "vim_up",
76: "vim_right",
};
export function handle(opts) {

View File

@ -70,6 +70,12 @@ export class SettingsPanelMenu {
enter_key: () => this.enter_panel(),
up_arrow: () => this.prev(),
down_arrow: () => this.next(),
// Binding vim keys as well
vim_left: toggler.maybe_go_left,
vim_right: toggler.maybe_go_right,
vim_up: () => this.prev(),
vim_down: () => this.next(),
},
});
}