From f076040c249a2b1ac1835ae992c0a57b87989658 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Fri, 29 May 2009 09:38:50 +0000 Subject: [PATCH] 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. --- src/uifc/uifc32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index b5a16aaffd..a95d1dc2dc 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -8,7 +8,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @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 * * 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 continue; } case CIO_KEY_DC: /* delete */ + case DEL: /* sdl_getch() is returning 127 when keypad "Del" is hit */ if(i<j) { if(str[i]=='.') -- GitLab