From aef409c4601014d65e3dc9975bb30fadfdfec731 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Sun, 2 Nov 2008 17:59:30 +0000 Subject: Terminfo driver needs to put terminal into 'keypad_xmit' mode when starting --- driver-ti.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 #include #include +#include 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, }; -- cgit v1.2.3-70-g09d2