Rename SwitchKeymap() to SwitchKeymapById()

This commit is contained in:
László Monda
2018-03-30 12:46:30 +02:00
parent ecf1f1ac32
commit 308a71e4a3
4 changed files with 6 additions and 6 deletions

View File

@@ -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;
}
}

View File

@@ -29,7 +29,7 @@
// Functions:
void SwitchKeymap(uint8_t index);
void SwitchKeymapById(uint8_t index);
bool SwitchKeymapByAbbreviation(uint8_t length, char *abbrev);
#endif

View File

@@ -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);
}

View File

@@ -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;
}