Initial work on keymap transforms for non-standard matrixes.

* Allows "gaps" for keyboards like Kyra.
* Allows keyboards with matrixes that don't map the logical key
  locations to have normal looking keymaps when defined.
This commit is contained in:
Pete Johanson
2020-06-15 17:03:34 -04:00
parent 0712dadd29
commit 1751470785
12 changed files with 1028 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#include <zmk/util.h>
#define KT_ROW(item) (item >> 8)
#define KT_COL(item) (item & 0xFF)
#define _ROW_COL(row, col) (((row) << 8) + (col))
#define _IDENTITY_ENTRY(col, row) _ROW_COL(row, col)
#define IDENTITY_ROW(row, count) UTIL_LISTIFY(count, _IDENTITY_ENTRY, row)
#define _OFFSET_ENTRY(col, offset, row) _ROW_COL(row, col + offset)
#define OFFSET_ROW(offset, row, count) UTIL_LISTIFY(count, _OFFSET_ENTRY, offset, row)