From d491f933b18a5a5817d2f56cb8b07fdedebcfbe1 Mon Sep 17 00:00:00 2001 From: Eliran Gonen <31196036+elig0n@users.noreply.github.com> Date: Sat, 11 Apr 2020 07:49:53 +0300 Subject: [PATCH] Extended default keys with mouse and vim navigation Mouse wheel up & down to scroll list one by one and left mouse button to select. Keyboard 'j' & 'k' for up one and down one. --- scripts/modules.js/SelectionMenu.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/modules.js/SelectionMenu.js b/scripts/modules.js/SelectionMenu.js index 18d6a20..c2f1212 100644 --- a/scripts/modules.js/SelectionMenu.js +++ b/scripts/modules.js/SelectionMenu.js @@ -53,13 +53,13 @@ var SelectionMenu = function(settings) settings.autoCloseDelay >= 0 ? settings.autoCloseDelay : 5; // 0 = Off. this.autoCloseActiveAt = 0; this.keyBindings = { // Default keybindings. - 'Menu-Up':{repeatable:true, keys:['up']}, - 'Menu-Down':{repeatable:true, keys:['down']}, + 'Menu-Up':{repeatable:true, keys:['up','WHEEL_UP', 'k'] }, + 'Menu-Down':{repeatable:true, keys:['down', 'WHEEL_DOWN', 'j' ]}, 'Menu-Up-Fast':{repeatable:true, keys:['shift+up']}, 'Menu-Down-Fast':{repeatable:true, keys:['shift+down']}, 'Menu-Left':{repeatable:true, keys:['left']}, 'Menu-Right':{repeatable:false, keys:['right']}, - 'Menu-Open':{repeatable:false, keys:['enter']}, + 'Menu-Open':{repeatable:false, keys:['enter', 'MBTN_LEFT']}, 'Menu-Undo':{repeatable:false, keys:['bs']}, 'Menu-Help':{repeatable:false, keys:['h']}, 'Menu-Close':{repeatable:false, keys:['esc']}