💥NOTE💥: Don't do this yet, all of this stuff is still 🚑💣BLEEDING EDGE💣🚑, and you will 🔪cut yourself🔪 badly if you choose to do it. Please wait for 🗿Wilba's QMK code to be refactored prior to pushing anything to QMK, as we don't want to end up with a bunch of different forks of the code.
So you've seen VIA Configurator in action, and you want to get this magic supported for your board?
There's two main steps:
- Add dynamic keymap support to keyboard in QMK
- Add layout to VIA
Here's an example port of the Iris that was done based on the WT60-A code:
Wilba suggests looking at the WT60-A as an example on getting a PCB compatible with VIA Configurator.
- Make sure
VENDOR_ID
/PRODUCT_ID
combo is unique, as VIA uses this to detect what board is used. You'll need this later on. - Add the lines for EEPROM and DYNAMIC_KEYMAP stuff at the bottom. Make sure you change the values for
DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
andDYNAMIC_KEYMAP_MACRO_EEPROM_SIZE
as specified below.
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage
// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x08
#define EEPROM_VERSION_ADDR 34
// Dynamic keymap starts after EEPROM version
#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480)
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515 // **** CHANGE THIS BASED ON MATRIX_ROWS & MATRIX_COLS ****
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // **** CHANGE THIS BASED ON 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR ****
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR = DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2)
DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE = 1024 - DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
Remove code for matrix_init_kb(void)
.
Add:
SRC += keyboards/wilba_tech/wt_main.c
RAW_ENABLE = yes
DYNAMIC_KEYMAP_ENABLE = yes
Remove any unnecessary features to clear up room for the dynamic keymap code being compiled into the .hex file.
Clone the VIA Configurator repo and create a new branch.
- Add new layout macro name in the
import {...} from './kle-parser';
section - Add device info to
DEVICE_META_MAP: DeviceMetaMap
- Add VENDOR_ID/PRODUCT_ID combo to
isValidVendorProduct
function
- Copy LAYOUT macro from keyboard in QMK and paste into file as a new exported const
- Add layout to
MatrixLayout
- Create layout in KLE
- For boards with columnar stagger (ergolumnar), right now, keep everything in the same row aligned together
- Copy "Raw data" output
- Add
export const LAYOUT_<keyboard name>
and paste KLE raw data output into it - If spacing between two keys in a row or the spacing from the edge to the first key in a row shows up weird, open up
Key.css
and copy/create a new indent class for the missing spacing, as seen here: https://github.com/olivia/via-config/pull/35/commits/d79e788d45b19d373cb977a7d0e3e9d700978987