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

Function AddToKeyQueue

outdated/sys/mac/macwin.c:162–177  ·  view source on GitHub ↗

* Add key to input queue, force means flush left and replace if full */

Source from the content-addressed store, hash-verified

160 * Add key to input queue, force means flush left and replace if full
161 */
162void
163AddToKeyQueue(unsigned char ch, Boolean force)
164{
165 if (keyQueueCount < QUEUE_LEN) {
166 keyQueue[keyQueueWrite++] = ch;
167 keyQueueCount++;
168 } else if (force) {
169 keyQueue[keyQueueWrite++] = ch;
170 keyQueueRead++;
171 if (keyQueueRead >= QUEUE_LEN)
172 keyQueueRead = 0;
173 keyQueueCount = QUEUE_LEN;
174 }
175 if (keyQueueWrite >= QUEUE_LEN)
176 keyQueueWrite = 0;
177}
178
179/*
180 * Get key from queue

Callers 12

AppleEventHandlerFunction · 0.85
WindowGoAwayFunction · 0.85
BaseEventFunction · 0.85
MsgClickFunction · 0.85
MsgEventFunction · 0.85
MenwKeyFunction · 0.85
MenwClickFunction · 0.85
TextKeyFunction · 0.85
GeneralKeyFunction · 0.85
DoMenuEvtFunction · 0.85
askSaveFunction · 0.85
askQuitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected