Skip to content

Commit d890616

Browse files
authored
Merge branch 'main' into main
2 parents 3e00020 + b523196 commit d890616

File tree

1,304 files changed

+10939741
-122614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,304 files changed

+10939741
-122614
lines changed

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@
1414
branch = ambrylight
1515
[submodule "hackpads/n16-remote"]
1616
path = hackpads/n16-remote
17-
url = https://github.com/DJ-Laser/n16-remote
17+
url = https://github.com/DJ-Laser/n16-remot
18+
[submodule "hackpads/shrekpad"]
19+
path = hackpads/shrekpad
20+
url = https://github.com/daamin909/shrekpad

My cool hackpad kubas fake calculator/CAD/hacpad everything.step

Lines changed: 164019 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import board
2+
import time
3+
from kmk.kmk_keyboard import KMKKeyboard
4+
from kmk.scanners.keypad import MatrixScanner
5+
from kmk.keys import KC
6+
from kmk.modules.rotary_encoder import RotaryEncoderHandler
7+
from kmk.extensions.peg_rgb_matrix import Rgb_matrix
8+
9+
keyboard = KMKKeyboard()
10+
11+
rgb = Rgb_matrix()
12+
keyboard.extensions.append(rgb)
13+
14+
15+
keyboard.matrix = MatrixScanner(
16+
column_pins=[board.GP3, board.GP4, board.GP2, board.GP1],
17+
row_pins=[board.GP27, board.GP28, board.G29],
18+
value_when_pressed=False,
19+
)
20+
21+
keyboard.keymap = [
22+
#layer0
23+
[
24+
[KC.F13, KC.F14, KC.F15, KC.F16,],
25+
[KC.F17, KC.F18, KC.F19, KC.F20,],
26+
[KC.F21, KC.F22, KC.F23, KC.F24,],
27+
],
28+
#layer1
29+
[
30+
[KC.F25, KC.F26, KC.F27, KC.F28,],
31+
[KC.F29, KC.F30, KC.F31, KC.F32,],
32+
[KC.F33, KC.F34, KC.F35, KC.F36,],
33+
],
34+
#layer2
35+
[
36+
[KC.F37, KC.F38, KC.F39, KC.F40,],
37+
[KC.F41, KC.F42, KC.F43, KC.F44,],
38+
[KC.F45, KC.F46, KC.F47, KC.F48,],
39+
],
40+
]
41+
42+
43+
44+
45+
def switch_layer(layer):
46+
keyboard.active_layers = [layer]
47+
if layer == 0:
48+
keyboard.set_pixel(0, 255, 0, 0)
49+
keyboard.set_pixel(1, 255, 1, 1)
50+
keyboard.set_pixel(2, 255, 2, 2)
51+
keyboard.set_pixel(3, 255, 3, 3)
52+
elif layer == 1:
53+
keyboard.set_pixel(0, 0, 255, 0)
54+
keyboard.set_pixel(1, 1, 255, 1)
55+
keyboard.set_pixel(2, 2, 255, 2)
56+
keyboard.set_pixel(3, 3, 255, 3)
57+
elif layer == 2:
58+
keyboard.set_pixel(0, 0, 0, 255)
59+
keyboard.set_pixel(1, 1, 1, 255)
60+
keyboard.set_pixel(2, 2, 2, 255)
61+
keyboard.set_pixel(3, 3, 3, 255)
62+
rgb.write()
63+
64+
current_layer = 0
65+
switch_layer(current_layer)
66+
67+
encoder = RotaryEncoderHandler(pin_a=board.GP7, pin_b=board.GP6,pin_S1=board.GP1)
68+
encoder.rotation_cw = KC.VOLU
69+
encoder.rotation_ccw = KC.VOLD
70+
keyboard.modules.append(encoder)
71+
72+
while True:
73+
keyboard.update()
74+
if keyboard.matrix.is_pressed(0, 0):
75+
current_layer = (current_layer + 1) % 3
76+
switch_layer(current_layer)
77+
time.sleep(0.3)
78+
79+
80+
if __name__ == '__main__':
81+
keyboard.go()

0 commit comments

Comments
 (0)