Mercurial > hg > early-roguelike
changeset 150:a307ff9cd95e
arogue7: fix the backspace key in prompts.
md_readchar() now translates KEY_BACKSPACE to the erase character.
XRogue seems to work already.
author | John "Elwin" Edwards |
---|---|
date | Thu, 28 May 2015 09:41:29 -0400 |
parents | 9aa9b9a2e159 |
children | cadff8f047a1 |
files | arogue7/mdport.c arogue7/options.c |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/arogue7/mdport.c Wed May 27 17:29:32 2015 -0400 +++ b/arogue7/mdport.c Thu May 28 09:41:29 2015 -0400 @@ -1117,6 +1117,10 @@ #endif case KEY_NPAGE : ch = 'n'; break; +#ifdef KEY_BACKSPACE + case KEY_BACKSPACE: ch = md_erasechar(); break; +#endif + #ifdef KEY_B1 case KEY_B1 : ch = 'h'; break; case KEY_C2 : ch = 'j'; break;
--- a/arogue7/options.c Wed May 27 17:29:32 2015 -0400 +++ b/arogue7/options.c Thu May 28 09:41:29 2015 -0400 @@ -216,7 +216,7 @@ * loop reading in the string, and put it in a temporary buffer */ for (sp = buf; - (c = wgetch(win)) != '\n' && + (c = md_readchar(win)) != '\n' && c != '\r' && c != '\033' && c != '\007' &&