diff options
-rw-r--r-- | xP/public/xP.js | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js index f80182a..d3b2d16 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -817,11 +817,8 @@ document.addEventListener('keydown', event => { if (rpc.ws == undefined || !hasShortcutModifiers(event)) return + let names = undefined switch (event.key) { - case 'Tab': - if (bufferLast !== undefined) - bufferActivate(bufferLast) - break case 'h': bufferToggleLog() break @@ -839,6 +836,26 @@ document.addEventListener('keydown', event => { break } break + case 'Tab': + if (bufferLast !== undefined) + bufferActivate(bufferLast) + break + case 'PageUp': + names = [...buffers.keys()] + for (let i = 0; i < names.length; i++) + if (names[i] === bufferCurrent) { + bufferActivate(names.at(--i)) + break + } + break + case 'PageDown': + names = [...buffers.keys()] + for (let i = 0; i < names.length; i++) + if (names[i] === bufferCurrent) { + bufferActivate(names.at(++i) || names[0]) + break + } + break default: return } |