changeset 94:ba9930a7f99d

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.
author John "Elwin" Edwards
date Tue, 27 Aug 2013 09:25:30 -0700
parents 8f7c082fde46
children 88ab59f06dfc
files rogue3/mdport.c rogue4/mdport.c rogue5/mdport.c
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rogue3/mdport.c	Mon Aug 26 19:58:44 2013 -0700
+++ b/rogue3/mdport.c	Tue Aug 27 09:25:30 2013 -0700
@@ -1381,8 +1381,8 @@
 	    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
 	}
 
--- a/rogue4/mdport.c	Mon Aug 26 19:58:44 2013 -0700
+++ b/rogue4/mdport.c	Tue Aug 27 09:25:30 2013 -0700
@@ -1306,6 +1306,9 @@
             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
         }
 
         break;
--- a/rogue5/mdport.c	Mon Aug 26 19:58:44 2013 -0700
+++ b/rogue5/mdport.c	Tue Aug 27 09:25:30 2013 -0700
@@ -1384,8 +1384,8 @@
 	    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
 	}