aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-02 17:59:30 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-02 17:59:30 +0000
commitaef409c4601014d65e3dc9975bb30fadfdfec731 (patch)
tree52d31a29372b761635158d010b2216231c09ace3
parent5107112a91895c357da0131424e229d75f5b9462 (diff)
downloadtermo-aef409c4601014d65e3dc9975bb30fadfdfec731.tar.gz
termo-aef409c4601014d65e3dc9975bb30fadfdfec731.tar.xz
termo-aef409c4601014d65e3dc9975bb30fadfdfec731.zip
Terminfo driver needs to put terminal into 'keypad_xmit' mode when starting
-rw-r--r--driver-ti.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/driver-ti.c b/driver-ti.c
index 7cff1ca..970d2a5 100644
--- a/driver-ti.c
+++ b/driver-ti.c
@@ -7,6 +7,7 @@
#include <ctype.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
struct ti_keyinfo {
const char *seq;
@@ -75,6 +76,25 @@ abort_free_ti:
return NULL;
}
+static void start_driver(termkey_t *tk)
+{
+ /* The terminfo database will contain keys in application cursor key mode.
+ * We may need to enable that mode
+ */
+ if(keypad_xmit) {
+ // Can't call putp or tputs because they suck and don't give us fd control
+ write(tk->fd, keypad_xmit, strlen(keypad_xmit));
+ }
+}
+
+static void stop_driver(termkey_t *tk)
+{
+ if(keypad_local) {
+ // Can't call putp or tputs because they suck and don't give us fd control
+ write(tk->fd, keypad_local, strlen(keypad_local));
+ }
+}
+
static void free_driver(void *private)
{
}
@@ -236,5 +256,8 @@ struct termkey_driver termkey_driver_ti = {
.new_driver = new_driver,
.free_driver = free_driver,
+ .start_driver = start_driver,
+ .stop_driver = stop_driver,
+
.getkey = getkey,
};