MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / HandleHotkeyDown

Function HandleHotkeyDown

src/InputHandler.c:729–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727}
728
729static void HandleHotkeyDown(int key) {
730 struct HotkeyData* hkey;
731 cc_string text;
732 int i = Hotkeys_FindPartial(key);
733
734 if (i == -1) return;
735 hkey = &HotkeysList[i];
736 text = StringsBuffer_UNSAFE_Get(&HotkeysText, hkey->textIndex);
737
738 if (!(hkey->flags & HOTKEY_FLAG_STAYS_OPEN)) {
739 Chat_Send(&text, false);
740 } else if (!Gui.InputGrab) {
741 ChatScreen_OpenInput(&text);
742 }
743}
744
745static void HookInputBinds(void) {
746 Bind_OnTriggered[BIND_HIDE_FPS] = BindTriggered_HideFPS;

Callers 1

OnInputDownFunction · 0.85

Calls 4

Hotkeys_FindPartialFunction · 0.85
StringsBuffer_UNSAFE_GetFunction · 0.85
Chat_SendFunction · 0.85
ChatScreen_OpenInputFunction · 0.85

Tested by

no test coverage detected