fix: correct layers + lt

This commit is contained in:
Bastien Riviere 2024-04-24 17:03:43 +02:00
parent 805d0da4bc
commit 7bc87e97d9
Signed by: babariviere
GPG key ID: 4E5F0839249F162E
2 changed files with 63 additions and 7 deletions

View file

@ -5,20 +5,22 @@
#include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h> #include <dt-bindings/zmk/bt.h>
#include "zmk-helpers/key-labels/34.h" // Cannot use it with keymap-drawer
/* #include "zmk-helpers/key-labels/34.h" */
#include "keypos.h"
#define BASE 0 #define BASE 0
#define SYM 1 #define SYM 1
#define NAV 2 #define NAV 2
#define WNAV 3 #define WNAV 3
#define NUM 5 #define NUM 4
#define FUN 6 #define FUN 5
#define MODS 7 #define MODS 6
#define FRA 8 #define FRA 7
#define VOL_DN C_VOL_DN #define VOL_DN C_VOL_DN
#define VOL_UP C_VOL_UP #define VOL_UP C_VOL_UP
#define SPC_NUM &lt SPACE NUM #define SPC_NUM &lt NUM SPACE
#define BT_PRF(num) &bt BT_SEL num #define BT_PRF(num) &bt BT_SEL num
@ -73,7 +75,7 @@
combo_tab { combo_tab {
timeout-ms = <25>; timeout-ms = <25>;
key-positions = <LM2 LM1>; key-positions = <LM2 LM1>;
bindings = <&lt TAB MODS>; bindings = <&lt MODS TAB>;
}; };
combo_l_cmd { combo_l_cmd {
timeout-ms = <25>; timeout-ms = <25>;

54
config/keypos.h Normal file
View file

@ -0,0 +1,54 @@
// From: https://github.com/urob/zmk-helpers/blob/v2/include/zmk-helpers/key-labels/34.h
/* 34 KEY MATRIX / LAYOUT MAPPING
0 1 2 3 4 5 6 7 8 9 LT4 LT3 LT2 LT1 LT0 RT0 RT1 RT2 RT3 RT4
10 11 12 13 14 15 16 17 18 19 LM4 LM3 LM2 LM1 LM0 RM0 RM1 RM2 RM3 RM4
20 21 22 23 24 25 26 27 28 29 LB4 LB3 LB2 LB1 LB0 RB0 RB1 RB2 RB3 RB4
30 31 32 33 LH1 LH0 RH0 RH1
*/
#pragma once
#define LT0 4 // left-top row
#define LT1 3
#define LT2 2
#define LT3 1
#define LT4 0
#define RT0 5 // right-top row
#define RT1 6
#define RT2 7
#define RT3 8
#define RT4 9
#define LM0 14 // left-middle row
#define LM1 13
#define LM2 12
#define LM3 11
#define LM4 10
#define RM0 15 // right-middle row
#define RM1 16
#define RM2 17
#define RM3 18
#define RM4 19
#define LB0 24 // left-bottom row
#define LB1 23
#define LB2 22
#define LB3 21
#define LB4 20
#define RB0 25 // right-bottom row
#define RB1 26
#define RB2 27
#define RB3 28
#define RB4 29
#define LH0 31 // left thumb keys
#define LH1 30
#define RH0 32 // right thumb keys
#define RH1 33