diff options
Diffstat (limited to 'driver-ti.c')
-rw-r--r-- | driver-ti.c | 23 |
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, }; |