From af98c062cbef514f640e790cc9e3e569ef347d19 Mon Sep 17 00:00:00 2001 From: Florrie Date: Mon, 4 Jun 2018 16:00:19 -0300 Subject: 1, 2 to focus main/queue listings --- README.md | 2 ++ tui-lib | 2 +- ui.js | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 564dd03..aff943a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ * Up and Down - select previous or next item in a listing * PageUp and PageDown - navigate up or down a visible-page-length of a listing (the usual meaning of page-up/down!) * Tab and Shift+Tab - switch between UI elements +* 1 - focus the main track/group listing +* 2 - focus the queue listing * Enter - play the selected track * Shift+Up - play previous track * Shift+Down - play next track diff --git a/tui-lib b/tui-lib index a3df7cf..c42add3 160000 --- a/tui-lib +++ b/tui-lib @@ -1 +1 @@ -Subproject commit a3df7cf7205d12ab5e6fc7b5746cae6c4a6a8214 +Subproject commit c42add3c9edb6446a759ae4f5a2b3e81cf56f4f5 diff --git a/ui.js b/ui.js index 3090873..47270bd 100644 --- a/ui.js +++ b/ui.js @@ -137,6 +137,12 @@ class AppElement extends FocusElement { this.playPreviousTrack(this.playingTrack) } else if (telc.isShiftDown(keyBuf)) { this.playNextTrack(this.playingTrack) + } else if (telc.isCharacter(keyBuf, '1') && this.grouplikeListingElement.selectable) { + this.form.curIndex = this.form.inputs.indexOf(this.grouplikeListingElement) + this.form.updateSelectedElement() + } else if (telc.isCharacter(keyBuf, '2') && this.queueListingElement.selectable) { + this.form.curIndex = this.form.inputs.indexOf(this.queueListingElement) + this.form.updateSelectedElement() } else { super.keyPressed(keyBuf) } -- cgit 1.3.0-6-gf8a5