From a719a1154fde92d8d27a94ca0a7b21637209342e Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 20 May 2006 08:45:19 +0000 Subject: [PATCH] * Got backspace to work with the slang and ncurses drivers in an X terminal window. --- caca/driver_ncurses.c | 3 ++- caca/driver_slang.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/caca/driver_ncurses.c b/caca/driver_ncurses.c index 5dd18a9..6155885 100644 --- a/caca/driver_ncurses.c +++ b/caca/driver_ncurses.c @@ -238,7 +238,7 @@ static int ncurses_get_event(caca_display_t *dp, caca_event_t *ev) return 0; } - if(intkey < 0x80) + if(intkey < 0x7f) { ev->type = CACA_EVENT_KEY_PRESS; ev->data.key.ch = intkey; @@ -409,6 +409,7 @@ static int ncurses_get_event(caca_display_t *dp, caca_event_t *ev) case KEY_IC: ev->data.key.ch = CACA_KEY_INSERT; break; case KEY_DC: ev->data.key.ch = CACA_KEY_DELETE; break; + case 0x7f: case KEY_BACKSPACE: ev->data.key.ch = CACA_KEY_BACKSPACE; break; case KEY_HOME: ev->data.key.ch = CACA_KEY_HOME; break; case KEY_END: ev->data.key.ch = CACA_KEY_END; break; diff --git a/caca/driver_slang.c b/caca/driver_slang.c index a61a4e5..c7a9d3a 100644 --- a/caca/driver_slang.c +++ b/caca/driver_slang.c @@ -275,7 +275,7 @@ static int slang_get_event(caca_display_t *dp, caca_event_t *ev) } /* If the key was ASCII, return it immediately */ - if(intkey < 0x80) + if(intkey < 0x7f) { ev->type = CACA_EVENT_KEY_PRESS; ev->data.key.ch = intkey; @@ -318,6 +318,7 @@ static int slang_get_event(caca_display_t *dp, caca_event_t *ev) case SL_KEY_IC: ev->data.key.ch = CACA_KEY_INSERT; break; case SL_KEY_DELETE: ev->data.key.ch = CACA_KEY_DELETE; break; + case 0x7f: case SL_KEY_BACKSPACE: ev->data.key.ch = CACA_KEY_BACKSPACE; break; case SL_KEY_HOME: ev->data.key.ch = CACA_KEY_HOME; break; case SL_KEY_END: ev->data.key.ch = CACA_KEY_END; break;