Rename SwitchKeymap() to SwitchKeymapById()
This commit is contained in:
@@ -18,7 +18,7 @@ uint8_t AllKeymapsCount;
|
||||
uint8_t DefaultKeymapIndex;
|
||||
uint8_t CurrentKeymapIndex = 0;
|
||||
|
||||
void SwitchKeymap(uint8_t index)
|
||||
void SwitchKeymapById(uint8_t index)
|
||||
{
|
||||
CurrentKeymapIndex = index;
|
||||
ValidatedUserConfigBuffer.offset = AllKeymaps[index].offset;
|
||||
@@ -31,7 +31,7 @@ bool SwitchKeymapByAbbreviation(uint8_t length, char *abbrev)
|
||||
for (uint8_t i=0; i<MAX_KEYMAP_NUM; i++) {
|
||||
keymap_reference_t *keymap = AllKeymaps + i;
|
||||
if (keymap->abbreviationLen == length && strcmp(keymap->abbreviation, abbrev) == 0) {
|
||||
SwitchKeymap(i);
|
||||
SwitchKeymapById(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
// Functions:
|
||||
|
||||
void SwitchKeymap(uint8_t index);
|
||||
void SwitchKeymapById(uint8_t index);
|
||||
bool SwitchKeymapByAbbreviation(uint8_t length, char *abbrev);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -50,10 +50,10 @@ void UsbCommand_ApplyConfig(void)
|
||||
if (AllKeymaps[keymapId].abbreviationLen == oldKeymapAbbreviationLen &&
|
||||
!memcmp(oldKeymapAbbreviation, AllKeymaps[keymapId].abbreviation, oldKeymapAbbreviationLen))
|
||||
{
|
||||
SwitchKeymap(keymapId);
|
||||
SwitchKeymapById(keymapId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
SwitchKeymap(DefaultKeymapIndex);
|
||||
SwitchKeymapById(DefaultKeymapIndex);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ void applyKeyAction(key_state_t *keyState, key_action_t *action)
|
||||
break;
|
||||
case KeyActionType_SwitchKeymap:
|
||||
if (!keyState->previous) {
|
||||
SwitchKeymap(action->switchKeymap.keymapId);
|
||||
SwitchKeymapById(action->switchKeymap.keymapId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user