-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeymap.rb
134 lines (114 loc) · 2.82 KB
/
keymap.rb
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# This keymap works on 0.9.17+
require "via"
require "consumer_key"
puts "==== Shotgun CherryPie ===="
kbd = Keyboard.new
# Use this pins if you have the production version
kbd.init_pins(
[ 9, 10, 11, 12, 14 ], # row0, row1,... respectively
[ 5, 4, 2, 3, 6, 7 ] # col0, col1,... respectively
)
# Pins of a prototype PCB
#kbd.init_pins(
# [ 11, 12, 13, 14, 15 ], # row0, row1,... respectively
# [ 9, 8, 7, 6, 2, 3] # col0, col1,... respectively
#)
# This keymap assumes it has five encoders on the left-most column
encoder_1 = RotaryEncoder.new(28, 27)
encoder_1.clockwise do
kbd.send_key :KC_RGUI, :KC_RCTL, :KC_RIGHT
end
encoder_1.counterclockwise do
kbd.send_key :KC_RGUI, :KC_RCTL, :KC_LEFT
end
kbd.append encoder_1
encoder_2 = RotaryEncoder.new(26, 22)
encoder_2.clockwise do
kbd.send_key :KC_LCTL, :KC_TAB
end
encoder_2.counterclockwise do
kbd.send_key :KC_LCTL, :KC_LSFT, :KC_TAB
end
kbd.append encoder_2
encoder_3 = RotaryEncoder.new(21, 20)
encoder_3.clockwise do
kbd.send_key %i(KC_LALT KC_TAB)
end
encoder_3.counterclockwise do
kbd.send_key %i(KC_LALT KC_LSFT KC_TAB)
end
kbd.append encoder_3
encoder_4 = RotaryEncoder.new(19, 18)
encoder_4.clockwise do
kbd.send_key :KC_VOLU
end
encoder_4.counterclockwise do
kbd.send_key :KC_VOLD
end
kbd.append encoder_4
encoder_5 = RotaryEncoder.new(17, 16)
encoder_5.clockwise do
kbd.send_key :RGB_SPI
end
encoder_5.counterclockwise do
kbd.send_key :RGB_SPD
end
kbd.append encoder_5
# for VIA/Remap
# encoder_1 = RotaryEncoder.new(27, 28)
# encoder_1.clockwise do
# kbd.inject_switch(0, 5)
# end
# encoder_1.counterclockwise do
# kbd.inject_switch(0, 4)
# end
# kbd.append encoder_1
# encoder_2 = RotaryEncoder.new(26, 22)
# encoder_2.clockwise do
# kbd.inject_switch(1, 5)
# end
# encoder_2.counterclockwise do
# kbd.inject_switch(1, 4)
# end
# kbd.append encoder_2
# encoder_3 = RotaryEncoder.new(21, 20)
# encoder_3.clockwise do
# kbd.inject_switch(2, 5)
# end
# encoder_3.counterclockwise do
# kbd.inject_switch(2, 4)
# end
# kbd.append encoder_3
# encoder_4 = RotaryEncoder.new(19, 18)
# encoder_4.clockwise do
# kbd.inject_switch(3, 5)
# end
# encoder_4.counterclockwise do
# kbd.inject_switch(3, 4)
# end
# kbd.append encoder_4
# encoder_5 = RotaryEncoder.new(17, 16)
# encoder_5.clockwise do
# kbd.inject_switch(4, 5)
# end
# encoder_5.counterclockwise do
# kbd.inject_switch(4, 4)
# end
# kbd.append encoder_5
rgb = RGB.new(
0,
28,
0,
false
)
rgb.effect = :swirl
kbd.append rgb
kbd.add_layer :default, %i[
KC_NO BOOTSEL KC_NO KC_NUMLOCK KC_A KC_B
KC_NO KC_KP_7 KC_KP_8 KC_KP_9 KC_C KC_D
KC_NO KC_KP_4 KC_KP_5 KC_KP_6 KC_E KC_F
KC_NO KC_KP_1 KC_KP_2 KC_KP_3 KC_G KC_H
KC_NO KC_KP_0 KC_NO KC_KP_DOT KC_I KC_J
]
kbd.define_mode_key :BOOTSEL, [ Proc.new { kbd.bootsel! }, nil, 300, nil ]
kbd.start!