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

Function amikbhit

sys/amiga/amiwind.c:545–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543#ifdef AMII_GRAPHICS
544
545int
546amikbhit(void)
547{
548 struct IntuiMessage *message;
549 while (KbdBuffered < KBDBUFFER / 2) {
550#ifdef AMIFLUSH
551 message = (struct IntuiMessage *) GetFMsg(HackPort);
552#else
553 message = (struct IntuiMessage *) GetMsg(HackPort);
554#endif
555 if (message) {
556 ProcessMessage(message);
557 if (lastevent.type != WEUNK && lastevent.type != WEKEY)
558 break;
559 } else
560 break;
561 }
562 return (lastevent.type == WEUNK) ? KbdBuffered : -1;
563}
564
565/*
566 * Get a character from the keyboard buffer, waiting if not available.

Callers 3

kbhitFunction · 0.85
WindowGetcharFunction · 0.85
WindowGeteventFunction · 0.85

Calls 2

GetFMsgFunction · 0.85
ProcessMessageFunction · 0.85

Tested by

no test coverage detected