Skip to content
Snippets Groups Projects
Commit f076040c authored by rswindell's avatar rswindell
Browse files

Bug-fix in ugetstr(): keypad "Del" key (at least in SDL-Windows mode) was

inserting an ASCII char 127 into the string rather that deleting the current
character (or the selected string, as the case may be). There was already a
translation from DEL to CIO_KEY_DC ("For compatibility with terminals lacking
special keys") in ulist(), but this translation did not exit in ugetstr(). I'm
sure if sdl_getch()'s behavior is expected/correct, but in any case, this fix
seemed to be the most appropriate.
parent 7ebf6a99
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This library is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
...@@ -2075,6 +2075,7 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int ...@@ -2075,6 +2075,7 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
continue; continue;
} }
case CIO_KEY_DC: /* delete */ case CIO_KEY_DC: /* delete */
case DEL: /* sdl_getch() is returning 127 when keypad "Del" is hit */
if(i<j) if(i<j)
{ {
if(str[i]=='.') if(str[i]=='.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment