Skip to content

Commit f04ef53

Browse files
committed
Multi-profile example
1 parent 14d6d38 commit f04ef53

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

code.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,52 @@
6262
),
6363
)
6464

65+
# Use different keymaps on different connections
66+
# Valid keys are "USB" and "BT0"-"BT9"
67+
keyboard.profiles = {
68+
"BT1": (
69+
# layer 0
70+
(
71+
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '-', '=', BACKSPACE,
72+
TAB, Q, W, E, R, T, Y, U, I, O, P, '[', ']', '|',
73+
L2CAP, A, S, D, F, G, H, J, K, L, ';', '"', ENTER,
74+
LSFT4, Z, X, C, V, L3B, N, M, ',', '.', '/', RSFT4,
75+
LCTRL, LALT,LGUI5, SPACE, MENU, RALT, L1, RCTRL
76+
),
77+
78+
# layer 1
79+
(
80+
'`', F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL,
81+
___, ___, UP, ___, ___, ___, ___, ___, ___, ___,SUSPEND,___,___,___,
82+
___,LEFT,DOWN,RIGHT,___, ___, ___, ___, ___, ___, ___, ___, ___,
83+
___, ___, ___, ___, ___,BOOT, ___,MACRO(1), ___, ___, ___, ___,
84+
___, ___, ___, ___, ___, ___, ___, ___
85+
),
86+
87+
# Other layers...
88+
),
89+
"BT2": (
90+
# layer 0
91+
(
92+
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '-', '=', BACKSPACE,
93+
TAB, Q, W, E, R, T, Y, U, I, O, P, '[', ']', '|',
94+
L2CAP, A, S, D, F, G, H, J, K, L, ';', '"', ENTER,
95+
LSFT4, Z, X, C, V, L3B, N, M, ',', '.', '/', RSFT4,
96+
LCTRL, LALT,LGUI5, SPACE, MENU, RALT, L1, RCTRL
97+
),
98+
99+
# layer 1
100+
(
101+
'`', F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL,
102+
___, ___, UP, ___, ___, ___, ___, ___, ___, ___,SUSPEND,___,___,___,
103+
___,LEFT,DOWN,RIGHT,___, ___, ___, ___, ___, ___, ___, ___, ___,
104+
___, ___, ___, ___, ___,BOOT, ___,MACRO(2), ___, ___, ___, ___,
105+
___, ___, ___, ___, ___, ___, ___, ___
106+
),
107+
108+
# Other layers...
109+
)
110+
}
65111

66112
def macro_handler(dev, n, is_down):
67113
if is_down:

0 commit comments

Comments
 (0)