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

Function tgetch

outdated/sys/mac/mttymain.c:301–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301int
302tgetch(void)
303{
304 EventRecord event;
305 long sleepTime = 0;
306 int ret = 0;
307
308 for (; !ret;) {
309 WaitNextEvent(-1, &event, sleepTime, 0);
310 HandleEvent(&event);
311 blink_cursor(_mt_window, event.when);
312 if (event.what == nullEvent) {
313 sleepTime = GetCaretTime();
314 } else {
315 sleepTime = 0;
316 }
317 ret = GetFromKeyQueue();
318 if (ret == CHAR_CR)
319 ret = CHAR_LF;
320 }
321 return ret;
322}
323
324void
325getreturn(char *str)

Callers 1

getreturnFunction · 0.70

Calls 3

HandleEventFunction · 0.85
blink_cursorFunction · 0.85
GetFromKeyQueueFunction · 0.85

Tested by

no test coverage detected