MCPcopy Create free account
hub / github.com/NetHack/NetHack / modified

Function modified

win/curses/cursmisc.c:1081–1104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081static int
1082modified(int ch)
1083{
1084 int ret_ch = ch;
1085
1086#if defined(PDCURSES) && defined(PDC_KEY_MODIFIER_ALT)
1087 /* PDCurses key modifier masks:
1088 * PDC_KEY_MODIFIER_SHIFT = 1
1089 * PDC_KEY_MODIFIER_CONTROL = 2
1090 * PDC_KEY_MODIFIER_ALT = 4
1091 * PDC_KEY_MODIFIER_NUMLOCK = 8
1092 * PDC_KEY_MODIFIER_REPEAT = 16
1093 * ALT + 'a' through ALT + 'z' returns ALT_A through ALT_Z
1094 * and those are out of the normal character range and
1095 * code in curses_convert_keys() handles those.
1096 * ALT + 'A' through ALT + 'Z' return normal 'A' through 'Z'
1097 * so we check the modifier here.
1098 */
1099 if (((last_getch_modifiers & PDC_KEY_MODIFIER_ALT) == PDC_KEY_MODIFIER_ALT)
1100 && (ch >= 'A' && ch <= 'Z'))
1101 ret_ch = M(ch);
1102#endif
1103 return ret_ch;
1104}
1105
1106/*cursmisc.c*/

Callers 1

curses_convert_keysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected