« get me outta code hell

Add key detection functions for control+arrow keys - tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-08-25 13:12:27 -0300
committerFlorrie <towerofnix@gmail.com>2019-08-25 13:12:27 -0300
commitacb8c05987c72ceca423acf2f5761a50f641d1f8 (patch)
treed348dbaccb8428686cc64c68cb3c0a878744610b
parentddd817edd8d78311f811f3d0d06b138c0b295550 (diff)
Add key detection functions for control+arrow keys
-rw-r--r--util/telchars.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/telchars.js b/util/telchars.js
index 68294bf..5425468 100644
--- a/util/telchars.js
+++ b/util/telchars.js
@@ -76,6 +76,11 @@ const telchars = {
   isShiftRight: buf => compareBufStr(buf, '\x1b[1;2C'),
   isShiftLeft: buf => compareBufStr(buf, '\x1b[1;2D'),
 
+  isControlUp: buf => compareBufStr(buf, '\x1b[1;5A'),
+  isControlDown: buf => compareBufStr(buf, '\x1b[1;5B'),
+  isControlRight: buf => compareBufStr(buf, '\x1b[1;5C'),
+  isControlLeft: buf => compareBufStr(buf, '\x1b[1;5D'),
+
   isPageUp: buf => compareBufStr(buf, '\x1b[5~'),
   isPageDown: buf => compareBufStr(buf, '\x1b[6~'),