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

Function Input_Keyboard_NextKey

src/input/input.c:689–724  ·  view source on GitHub ↗

* Get the next key. * @return Next key. */

Source from the content-addressed store, hash-verified

687 * @return Next key.
688 */
689uint16 Input_Keyboard_NextKey(void)
690{
691 uint16 i;
692 uint16 value;
693
694 Input_AddHistory(0);
695
696 for (;; sleepIdle()) {
697 uint16 index;
698
699 index = s_historyHead;
700 if (g_mouseMode != INPUT_MOUSE_MODE_PLAY && index == s_historyTail) {
701 value = 0;
702 break;
703 }
704
705 value = s_history[index / 2];
706 if (g_mouseMode == INPUT_MOUSE_MODE_PLAY && value == 0) break;
707
708 for (i = 0; i < lengthof(s_keymapIgnore); i++) {
709 if (s_keymapIgnore[i] == (value & 0xFF)) break;
710 }
711
712 if (i == lengthof(s_keymapIgnore) && (value & 0x800) == 0 && (value & 0xFF) < 0x7A) break;
713
714 if ((value & 0xFF) >= 0x41 && (value & 0xFF) <= 0x44) index += 4;
715
716 s_historyHead = index + 2;
717 }
718
719 if (value != 0) {
720 value = Input_Keyboard_HandleKeys(value) & 0xFF;
721 }
722
723 return value;
724}
725

Callers 9

GameLoop_PlayAnimationFunction · 0.85
GameCredits_PlayFunction · 0.85
GameLoop_GameCreditsFunction · 0.85
Gameloop_LogosFunction · 0.85
GUI_EndStats_ShowFunction · 0.85
GUI_Security_ShowFunction · 0.85

Calls 2

Input_AddHistoryFunction · 0.85

Tested by

no test coverage detected