Implement keymap switching

This commit is contained in:
Eric Tang
2017-08-08 09:40:31 -07:00
parent 599e701479
commit 2621707206
7 changed files with 69 additions and 5 deletions

View File

@@ -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
{