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

Function is_altseq

sys/windows/consoletty.c:3358–3379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3356static int is_altseq(unsigned long shiftstate);
3357
3358static int
3359is_altseq(unsigned long shiftstate)
3360{
3361 /* We need to distinguish the Alt keys from the AltGr key.
3362 * On NT-based Windows, AltGr signals as right Alt and left Ctrl together;
3363 * on 95-based Windows, AltGr signals as right Alt only.
3364 * So on NT, we signal Alt if either Alt is pressed and left Ctrl is not,
3365 * and on 95, we signal Alt for left Alt only. */
3366 switch (shiftstate
3367 & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED)) {
3368 case LEFT_ALT_PRESSED:
3369 case LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED:
3370 return 1;
3371
3372 case RIGHT_ALT_PRESSED:
3373 case RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED:
3374 return (IsWindows8OrGreater());
3375
3376 default:
3377 return 0;
3378 }
3379}
3380
3381int ray_processkeystroke(
3382 HANDLE hConIn,

Callers 3

ray_processkeystrokeFunction · 0.85
process_keystroke2Function · 0.85
ray_kbhitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected