« get me outta code hell

Suspend support - 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>2019-03-10 10:51:29 -0300
committerFlorrie <towerofnix@gmail.com>2019-03-10 10:52:28 -0300
commit6da245d2d0a55f64caaf2bb185b343d4f227d0c3 (patch)
tree861037bdafd28ee82db065a14d0cd163544cf3a2 /ui.js
parent94414a2456d5302305e8801200177e9313b76858 (diff)
Suspend support
Should think about moving this into tui-lib! It'd fit the boilerplate
function I have there already (I think), but we're not making use of
that in mtui yet.
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index eb4a0a9..d9b652d 100644
--- a/ui.js
+++ b/ui.js
@@ -413,9 +413,12 @@ class AppElement extends FocusElement {
   }
 
   keyPressed(keyBuf) {
-    if (keyBuf[0] === 0x03) {
+    if (keyBuf[0] === 0x03) { // Ctrl-C
       this.shutdown()
       return
+    } else if (keyBuf[0] === 0x1a) { // Ctrl-Z
+      this.emit('suspendRequested')
+      return
     }
 
     if (telc.isRight(keyBuf)) {