From 5a25cd89da12e690f30bd12d440fb95902cf3de3 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Tue, 27 Aug 2013 09:25:30 -0700 Subject: [PATCH] rogue[345]: fix backspace key in prompts. md_readchar() mapped KEY_BACKSPACE to CTRL-H, but get_str(), which handles prompts for strings, only backs up when it receives the erase character. The key should be mapped to md_erasechar(). This fixes Red Hat Bugzilla #847852. --- rogue3/mdport.c | 4 ++-- rogue4/mdport.c | 3 +++ rogue5/mdport.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rogue3/mdport.c b/rogue3/mdport.c index f64db5f..6732f62 100644 --- a/rogue3/mdport.c +++ b/rogue3/mdport.c @@ -1381,8 +1381,8 @@ md_readchar(WINDOW *win) case ALT_PAD8 : ch = CTRL('K'); break; case ALT_PAD9 : ch = CTRL('U'); break; #endif -#ifdef KEY_BACKSPACE /* NCURSES in Keypad mode sends this for Ctrl-H */ - case KEY_BACKSPACE: ch = CTRL('H'); break; +#ifdef KEY_BACKSPACE + case KEY_BACKSPACE: ch = md_erasechar(); break; #endif } diff --git a/rogue4/mdport.c b/rogue4/mdport.c index c734b52..3a010db 100644 --- a/rogue4/mdport.c +++ b/rogue4/mdport.c @@ -1305,6 +1305,9 @@ md_readchar(WINDOW *win) case ALT_PAD7 : ch = MOD_MOVE('Y'); break; case ALT_PAD8 : ch = MOD_MOVE('K'); break; case ALT_PAD9 : ch = MOD_MOVE('U'); break; +#endif +#ifdef KEY_BACKSPACE + case KEY_BACKSPACE: ch = md_erasechar(); break; #endif } diff --git a/rogue5/mdport.c b/rogue5/mdport.c index e2cba78..62731ed 100644 --- a/rogue5/mdport.c +++ b/rogue5/mdport.c @@ -1384,8 +1384,8 @@ md_readchar(WINDOW *win) case ALT_PAD8 : ch = CTRL('K'); break; case ALT_PAD9 : ch = CTRL('U'); break; #endif -#ifdef KEY_BACKSPACE /* NCURSES in Keypad mode sends this for Ctrl-H */ - case KEY_BACKSPACE: ch = CTRL('H'); break; +#ifdef KEY_BACKSPACE + case KEY_BACKSPACE: ch = md_erasechar(); break; #endif }