From 2bdabe31cf42b34f8d7bb6015c383482cfb5d068 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 20 Dec 2009 10:01:57 +0000 Subject: Jonas Koelker points out that the backspace key didn't work in GTK Guess, because Guess expected ^H whereas GTK generated ^?. Other puzzles that use Backspace do it by being prepared to see either, which seems wasteful. Now the midend normalises both into ^H, so front ends can generate whichever they like while puzzles can safely just look for ^H. [originally from svn r8786] --- midend.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'midend.c') diff --git a/midend.c b/midend.c index 323ac97..1ba0fa3 100644 --- a/midend.c +++ b/midend.c @@ -753,6 +753,15 @@ int midend_process_key(midend *me, int x, int y, int button) button = CURSOR_SELECT2; /* + * Normalise both backspace characters (8 and 127) to \b. Easier + * to do this once, here, than to require all front ends to + * carefully generate the same one - now each front end can + * generate whichever is easiest. + */ + if (button == '\177') + button = '\b'; + + /* * Now send on the event we originally received. */ ret = ret && midend_really_process_key(me, x, y, button); -- cgit v1.1