« get me outta code hell

1, 2 to focus main/queue listings - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-06-04 16:00:19 -0300
committerFlorrie <towerofnix@gmail.com>2018-06-04 16:00:19 -0300
commitaf98c062cbef514f640e790cc9e3e569ef347d19 (patch)
tree48237850e627c0765e1561fa45eb7628f04b5e50 /ui.js
parent440fdb2fd1f546a50bbc2059fd7a76ecaa256d73 (diff)
1, 2 to focus main/queue listings
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js6
1 files changed, 6 insertions, 0 deletions
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)
     }