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

Function HandleKey

outdated/sys/mac/macwin.c:2995–3019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2993}
2994
2995static void
2996HandleKey(EventRecord *theEvent)
2997{
2998 WindowPtr theWindow = FrontWindow();
2999
3000 if (theEvent->modifiers & cmdKey) {
3001 if (theEvent->message & 0xff == '.') {
3002 /* Flush key queue */
3003 keyQueueCount = keyQueueWrite = keyQueueRead = 0;
3004 theEvent->message = '\033';
3005 goto dispatchKey;
3006 } else {
3007 UndimMenuBar();
3008 DoMenuEvt(MenuKey(theEvent->message & 0xff));
3009 }
3010 } else {
3011 dispatchKey:
3012 if (theWindow) {
3013 int kind = GetWindowKind(theWindow) - WIN_BASE_KIND;
3014 winKeyFuncs[kind](theEvent, theWindow);
3015 } else {
3016 GeneralKey(theEvent, (WindowPtr) 0);
3017 }
3018 }
3019}
3020
3021#endif /* !TARGET_API_MAC_CARBON */
3022

Callers 1

HandleEventFunction · 0.85

Calls 2

DoMenuEvtFunction · 0.85
GeneralKeyFunction · 0.85

Tested by

no test coverage detected