CheckKeybindingColission
This commit is contained in:
@@ -245,3 +245,16 @@ void CMD_OpenLogs() {
|
||||
void CMD_Errors() {
|
||||
CMD_OpenLogs();
|
||||
} RegisterCommand(CMD_Errors, "", "Opens the text editor logs and clear error counter");
|
||||
|
||||
void CheckKeybindingColission() {
|
||||
ForItem (x, GlobalCommands) {
|
||||
if (x.trigger == NULL) continue;
|
||||
ForItem (y, GlobalCommands) {
|
||||
if (y.trigger == NULL) continue;
|
||||
if (&x == &y) continue;
|
||||
if (x.trigger == y.trigger) {
|
||||
ReportErrorf("Hotkey colission between: '%S' and '%S'", x.name, y.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,6 +153,7 @@ void Set(String string) {
|
||||
if (trigger) {
|
||||
cmd->binding = quote;
|
||||
cmd->trigger = trigger;
|
||||
CheckKeybindingColission();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1005,6 +1005,7 @@ int main(int argc, char **argv)
|
||||
EnterOrEscapeKeySet = ParseKeyCached("escape | enter");
|
||||
AltEnterKeySet = ParseKeyCached("alt-enter");
|
||||
ShiftEnterKeySet = ParseKeyCached("shift-enter");
|
||||
CheckKeybindingColission();
|
||||
|
||||
|
||||
#if PLUGIN_CONFIG
|
||||
|
||||
Reference in New Issue
Block a user