« get me outta code hell

Un-selectable inputs - tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui/form/FocusElement.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-05-30 23:55:45 -0300
committerFlorrie <towerofnix@gmail.com>2018-05-30 23:55:45 -0300
commit553bbf486e043f206bb8f2c92c943fd688f8fedc (patch)
tree08366f0c8f9b0624f6b19d4e932fd286a1cab0f1 /ui/form/FocusElement.js
parentf782f7395cd287d4767c1f3ffd20a72a51007595 (diff)
Un-selectable inputs
Diffstat (limited to 'ui/form/FocusElement.js')
-rw-r--r--ui/form/FocusElement.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/form/FocusElement.js b/ui/form/FocusElement.js
index 18f13bf..79a8afc 100644
--- a/ui/form/FocusElement.js
+++ b/ui/form/FocusElement.js
@@ -25,11 +25,18 @@ module.exports = class FocusElement extends DisplayElement {
     this.isFocused = false
   }
 
+  get selectable() {
+    // Should be overridden if you want to make the element unselectable
+    // (according to particular conditions).
+
+    return true
+  }
+
   keyPressed(keyBuf) {
     // Do something with a buffer containing the key pressed (that is,
     // telnet data sent). Should be overridden in subclasses.
     //
-    // Keyboard characters are sent as a buffer in the form of
+    // Arrow keys are sent as a buffer in the form of
     // ESC[# where # is A, B, C or D. See more here:
     // http://stackoverflow.com/a/11432632/4633828
   }