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

Function Hotkeys_Add

src/InputHandler.c:141–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140
141void Hotkeys_Add(int trigger, cc_uint8 modifiers, const cc_string* text, cc_uint8 flags) {
142 struct HotkeyData* hk = HotkeysList;
143 int i;
144
145 for (i = 0; i < HotkeysText.count; i++, hk++) {
146 if (hk->trigger != trigger || hk->mods != modifiers) continue;
147 Hotkeys_RemoveText(hk->textIndex);
148
149 hk->flags = flags;
150 hk->textIndex = HotkeysText.count;
151 StringsBuffer_Add(&HotkeysText, text);
152 return;
153 }
154 Hotkeys_AddNewHotkey(trigger, modifiers, text, flags);
155}
156
157cc_bool Hotkeys_Remove(int trigger, cc_uint8 modifiers) {
158 struct HotkeyData* hk = HotkeysList;

Callers 3

StoredHotkey_ParseFunction · 0.85
CPE_SetTextHotkeyFunction · 0.85

Calls 3

Hotkeys_RemoveTextFunction · 0.85
StringsBuffer_AddFunction · 0.85
Hotkeys_AddNewHotkeyFunction · 0.85

Tested by

no test coverage detected