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

Function BaseEvent

outdated/sys/mac/macwin.c:2209–2282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2207
2208#if 0 // TARGET_API_MAC_CARBON
2209static pascal OSStatus
2210BaseEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata)
2211{
2212 NhWindow *wind = (NhWindow *) userdata;
2213
2214
2215 switch (GetEventClass(event)) {
2216 case kEventClassKeyboard: {
2217 char ch;
2218 UInt32 modifiers;
2219
2220
2221 GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL,
2222 sizeof(char), NULL, &ch);
2223 GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL,
2224 sizeof(UInt32), NULL, &modifiers);
2225 if (modifiers & cmdKey)
2226 return (eventNotHandledErr);
2227 AddToKeyQueue(topl_resp_key(ch), TRUE);
2228 return (noErr);
2229 }
2230
2231 case kEventClassMouse: {
2232 CGrafPtr saveport;
2233 GDHandle savedev;
2234 Point pt;
2235
2236 switch (GetEventKind(event)) {
2237 case kEventMouseMoved:
2238 GetEventParameter(event, kEventParamMouseLocation, typeQDPoint,
2239 NULL, sizeof(Point), NULL, &pt);
2240 GetGWorld(&saveport, &savedev);
2241 SetPortWindowPort(wind->its_window);
2242 GlobalToLocal(&pt);
2243 SetGWorld(saveport, savedev);
2244 BaseCursor(wind, pt);
2245 return (eventNotHandledErr);
2246 }
2247 break;
2248 }
2249
2250 case kEventClassWindow:
2251 switch (GetEventKind(event)) {
2252 case kEventWindowDrawContent:
2253 CallNextEventHandler(nexthandler, event);
2254 image_tty(NULL, wind->its_window);
2255 return (noErr);
2256
2257 case kEventWindowHandleContentClick: {
2258 CGrafPtr saveport;
2259 GDHandle savedev;
2260 Point pt;
2261 UInt32 modifiers;
2262
2263 GetEventParameter(event, kEventParamMouseLocation, typeQDPoint,
2264 NULL, sizeof(Point), NULL, &pt);
2265 GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL,
2266 sizeof(UInt32), NULL, &modifiers);

Callers

nothing calls this directly

Calls 5

AddToKeyQueueFunction · 0.85
topl_resp_keyFunction · 0.85
BaseCursorFunction · 0.85
image_ttyFunction · 0.85
BaseClickFunction · 0.85

Tested by

no test coverage detected