Implement keymap switching
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
#include "key_action.h"
|
||||
#include "arduino_hid/ConsumerAPI.h"
|
||||
#include "arduino_hid/SystemAPI.h"
|
||||
#include "keymaps.h"
|
||||
#include "led_display.h"
|
||||
#include "config_parser/parse_keymap.h"
|
||||
|
||||
// TODO: Restore Ctrl and Super keys and Mod+N.
|
||||
|
||||
keymap_reference_t AllKeymaps[MAX_KEYMAP_NUM] = { { "QTY", 3 } };
|
||||
uint8_t AllKeymapsCount;
|
||||
uint8_t DefaultKeymapIndex;
|
||||
uint8_t CurrentKeymapIndex = 0;
|
||||
|
||||
void Keymaps_Switch(uint8_t index) {
|
||||
CurrentKeymapIndex = index;
|
||||
UserConfigBuffer.offset = AllKeymaps[index].offset;
|
||||
ParseKeymap(&UserConfigBuffer, index, AllKeymapsCount);
|
||||
LedDisplay_SetText(AllKeymaps[index].abbreviationLen, AllKeymaps[index].abbreviation);
|
||||
}
|
||||
|
||||
key_action_t CurrentKeymap[LAYER_COUNT][SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE] = {
|
||||
// Base layer
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user