-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·91 lines (86 loc) · 6.63 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Lily base config: https://github.com/KMKfw/kmk_firmware/blob/master/boards/lily58/main.py
# Base key reference: https://github.com/KMKfw/kmk_firmware/blob/a309aa52f3b09309aa989f92de3ccc3537b996c8/kmk/keys.py
from kb import KMKKeyboard
from kmk.keys import KC
from kmk.modules.layers import Layers
from kmk.modules.power import Power
from kmk.modules.tapdance import TapDance
from kmk.modules.holdtap import HoldTap
from kmk.modules.combos import Combos
from kmk.hid import HIDModes
from kmk.extensions.peg_oled_Display import Oled,OledDisplayMode,OledReactionType,OledData
from kmk.extensions.peg_rgb_matrix import Rgb_matrix
from kmk.modules.split import Split
power = Power()
keyboard = KMKKeyboard()
modtap = HoldTap()
tapdance = TapDance()
tapdance.tap_time = 200
layers_ext = Layers()
combos = Combos()
keyboard.modules.append(power)
keyboard.modules.append(layers_ext)
keyboard.modules.append(modtap)
keyboard.modules.append(tapdance)
keyboard.modules.append(combos)
# oled
oled_ext = Oled(
OledData(
corner_one={0:OledReactionType.STATIC,1:["layer:"]},
corner_two={0:OledReactionType.LAYER,1:["1","2","3","4","5","6","7","8"]},
corner_three={0:OledReactionType.LAYER,1:["base","raise","lower","adjust","5","6","7","8"]},
corner_four={0:OledReactionType.LAYER,1:["main","nav","special","4","5","6","7","8"]}
),
toDisplay=OledDisplayMode.TXT,flip=False
)
# # oled
keyboard.extensions.append(oled_ext)
# KMK uses the final character in the name of the drive (luluL or luluR) to
# determine the side.
split = Split(use_pio=True)
keyboard.modules.append(split)
LOWER = KC.MO(1)
RAISE = KC.MO(2)
DLFT = KC.LCTL(KC.LEFT) # Desktop left
DRGT = KC.LCTL(KC.RIGHT) # Desktop right
# tap once for tab, hold for cmd, double tap for cmd + tab
LGUIPP = KC.TD(KC.HT(KC.TAB, KC.LGUI), KC.LGUI(KC.TAB))
# hold for control, double tap for control + tab
LCTLPP = KC.TD(KC.LCTL, KC.LCTL(KC.TAB))
# tap for square brace, tap twice for curly brace
LBRC = KC.TD(KC.LBRC, KC.LCBR)
RBRC = KC.TD(KC.RBRC, KC.RCBR)
# tap for plus, hold for left alt
LALT = KC.HT(KC.PLUS, KC.LALT)
# keymap
keyboard.keymap = [
[# qwerty
KC.TAB, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.GRAVE,
LALT, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.MINUS,
KC.ESC, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCLN, KC.QUOTE,
KC.LSFT, KC.Z, KC.X, KC.C, KC.V, KC.B, LBRC, RBRC, KC.N, KC.M, KC.COMM, KC.DOT, KC.SLSH, KC.BSLS,
LOWER, LCTLPP, LGUIPP, KC.ENT, KC.SPC, KC.BSPC, RAISE, KC.RGUI
],
[ # lower
KC.F1, KC.F2, KC.F3, KC.F4, KC.F5, KC.F6, KC.F7, KC.F8, KC.F9, KC.F10, KC.F11, KC.F12,
KC.TILD, KC.TRNS, KC.UP, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.PIPE, KC.EQUAL,KC.TRNS,
KC.TRNS, KC.LEFT, KC.DOWN, KC.RIGHT,KC.TRNS, KC.TRNS, KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT,KC.TRNS, KC.TRNS,
KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, DLFT, KC.TRNS, KC.T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