From: nhmall Date: Tue, 28 Feb 2023 05:05:04 +0000 (-0500) Subject: return correct ALT-key sequences with PDCurses X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42e337c306590da8ab6c69e43df8ce73ba28c5b4;p=nethack return correct ALT-key sequences with PDCurses They weren't working at all because the values of ALT_A through ALT_Z were out of the normal char range with PDCurses, and caught by the default case in the switch, where reject got set. /* use key as-is unless it's out of normal char range */ reject = ((uchar) ret < 1 || ret > 255); --- diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index efc7ef8ee..0b60a6797 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -939,6 +939,35 @@ curses_convert_keys(int key) ret = iflags.num_pad ? '5' : 'g'; break; #endif /* KEY_B2 */ +#ifdef PDCURSES + case ALT_A: + case ALT_B: + case ALT_C: + case ALT_D: + case ALT_E: + case ALT_F: + case ALT_G: + case ALT_I: + case ALT_J: + case ALT_K: + case ALT_L: + case ALT_M: + case ALT_N: + case ALT_O: + case ALT_P: + case ALT_Q: + case ALT_R: + case ALT_S: + case ALT_T: + case ALT_U: + case ALT_V: + case ALT_W: + case ALT_X: + case ALT_Y: + case ALT_Z: + ret = M((ret - ALT_A) + 'a'); + break; +#endif } /* phone layout is inverted, 123 on top and 789 on bottom; if player has