| 171 | } |
| 172 | |
| 173 | int Hotkeys_FindPartial(int key) { |
| 174 | struct HotkeyData hk; |
| 175 | int i, modifiers = 0; |
| 176 | |
| 177 | if (Input_IsCtrlPressed()) modifiers |= HOTKEY_MOD_CTRL; |
| 178 | if (Input_IsShiftPressed()) modifiers |= HOTKEY_MOD_SHIFT; |
| 179 | if (Input_IsAltPressed()) modifiers |= HOTKEY_MOD_ALT; |
| 180 | |
| 181 | for (i = 0; i < HotkeysText.count; i++) { |
| 182 | hk = HotkeysList[i]; |
| 183 | /* e.g. if holding Ctrl and Shift, a hotkey with only Ctrl modifiers matches */ |
| 184 | if ((hk.mods & modifiers) == hk.mods && hk.trigger == key) return i; |
| 185 | } |
| 186 | return -1; |
| 187 | } |
| 188 | |
| 189 | static const cc_string prefix = String_FromConst("hotkey-"); |
| 190 | static void StoredHotkey_Parse(cc_string* key, cc_string* value) { |