« get me outta code hell

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:
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)) {