MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Input_WaitForValidInput

Function Input_WaitForValidInput

src/input/input.c:661–683  ·  view source on GitHub ↗

* Wait for valid input. * @return Read input. (ASCII VALUE or > 0x80) */

Source from the content-addressed store, hash-verified

659 * @return Read input. (ASCII VALUE or > 0x80)
660 */
661uint16 Input_WaitForValidInput(void)
662{
663 uint16 index = 0;
664 uint16 value, i;
665
666 do {
667 for (;; sleepIdle()) {
668 if (g_mouseMode == INPUT_MOUSE_MODE_PLAY) break;
669
670 index = s_historyHead;
671 if (index != s_historyTail) break;
672 }
673
674 value = Input_ReadHistory(index);
675 for (i = 0; i < lengthof(s_keymapIgnore); i++) {
676 if ((value & 0xFF) == s_keymapIgnore[i]) break;
677 }
678 } while (i < lengthof(s_keymapIgnore) || (value & 0x800) != 0 || (value & 0xFF) >= 0x7A);
679
680 value = Input_Keyboard_HandleKeys(value);
681 Input_ReadInputFromFile();
682 return value & 0xFF;
683}
684
685/**
686 * Get the next key.

Calls 3

Input_ReadHistoryFunction · 0.85
Input_ReadInputFromFileFunction · 0.85

Tested by

no test coverage detected