Skip to content

Commit 22b9e83

Browse files
committed
fix regression.
1 parent b382427 commit 22b9e83

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

resources/lightcycle.html

+8-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ <h3>Keys</h3>
4848
<option value="false">No</option>
4949
<option value="true">Yes</option>
5050
</select>
51+
<label for="keys.switch-type">Key Hole</label>
52+
<select id="keys.switch-type" name="keys.switch-type">
53+
<option value="box">Box and MX</option>
54+
<option value="mx">MX</option>
55+
<option value="alps">Alps</option>
56+
<option value="choc">Choc (Experimental)</option>
57+
</select>
5158
</fieldset>
5259
<label for="curve">
5360
<h3>Curvature & Tenting</h3>
@@ -202,4 +209,4 @@ <h3>Miscelania</h3>
202209
</ul>
203210
</div>
204211
</div>
205-
{% endblock %}
212+
{% endblock %}

resources/public/lightcycle.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"num-row": false,
55
"last-row": false,
66
"thumb-count": "two",
7+
"switch-type": "box",
78
"hide-last-pinky": false
89
},
910
"curve": {

src/dactyl_keyboard/generator.clj

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
{:keys {:columns (get confs :configuration-ncols)
5454
:num-row (get confs :configuration-use-numrow?)
5555
:last-row (get confs :configuration-use-lastrow?)
56+
:switch-type (get confs :configuration-switch-type)
5657
:thumb-count (get confs :configuration-thumb-count)
5758
:hide-last-pinky (get confs :configuration-hide-last-pinky?)}
5859
:curve {:alpha (get confs :configuration-alpha)

src/dactyl_keyboard/handler.clj

+9-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"zero" :zero
6262
"full" :full
6363
:two)
64-
switch-type (case (get p "keys.switch-type")
64+
param-switch-type (case (get p "keys.switch-type")
6565
"mx" :mx
6666
"alps" :alps
6767
"choc" :choc
@@ -113,7 +113,7 @@
113113
:configuration-ncols param-ncols
114114
:configuration-thumb-count param-thumb-count
115115
:configuration-last-row-count param-last-row-count
116-
:configuration-switch-type switch-type
116+
:configuration-switch-type param-switch-type
117117
:configuration-use-inner-column? param-inner-column
118118
:configuration-hide-last-pinky? param-hide-last-pinky
119119

@@ -170,6 +170,11 @@
170170
"six" :six
171171
"eight" :eight
172172
:five)
173+
param-switch-type (case (get p "keys.switch-type")
174+
"mx" :mx
175+
"alps" :alps
176+
"choc" :choc
177+
:box)
173178
param-hide-last-pinky (parse-bool (get p "keys.hide-last-pinky"))
174179
param-alpha (parse-int (get p "curve.alpha"))
175180
param-beta (parse-int (get p "curve.beta"))
@@ -205,6 +210,7 @@
205210
:configuration-thumb-count param-thumb-count
206211
:configuration-hide-last-pinky? param-hide-last-pinky
207212
:configuration-use-wide-pinky? param-use-wide-pinky
213+
:configuration-switch-type param-switch-type
208214

209215
:configuration-alpha (if generate-json? param-alpha (/ pi param-alpha))
210216
:configuration-beta (if generate-json? param-beta (/ pi param-beta))
@@ -307,6 +313,7 @@
307313
c {:configuration-ncols (get keys :columns 5)
308314
:configuration-use-numrow? (get keys :num-row false)
309315
:configuration-use-lastrow? (get keys :last-row false)
316+
:configuration-switch-type (keyword (get keys :switch-type "box"))
310317
:configuration-thumb-count (keyword (get keys :thumb-count "two"))
311318
:configuration-create-side-nub? false
312319
:configuration-use-alps? false

src/dactyl_keyboard/lightcycle.clj

+10-8
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,19 @@
6060
beta (get c :configuration-beta)
6161
tenting-angle (get c :configuration-tenting-angle)
6262
z-offset (get c :configuration-z-offset)
63+
switch-type (get c :configuration-switch-type)
6364
manuform-offset? (get c :configuration-manuform-offset? false)
6465
offset (if manuform-offset?
6566
(manuform-column-offset column)
6667
(column-offset column))
6768
column-angle (* beta (- 2 column))
6869
placed-shape (->> shape
69-
(translate [(wide-pinky c column row) 0 (- (frow-radius alpha))])
70+
(translate [(wide-pinky c column row) 0 (- (frow-radius alpha switch-type))])
7071
(rotate (* alpha (- 2 row)) [1 0 0])
71-
(translate [0 0 (frow-radius alpha)])
72-
(translate [0 0 (- (fcolumn-radius beta))])
72+
(translate [0 0 (frow-radius alpha switch-type)])
73+
(translate [0 0 (- (fcolumn-radius beta switch-type))])
7374
(rotate column-angle [0 1 0])
74-
(translate [0 0 (fcolumn-radius beta)])
75+
(translate [0 0 (fcolumn-radius beta switch-type)])
7576
(translate offset))]
7677
(->> placed-shape
7778
(rotate tenting-angle [0 1 0])
@@ -88,14 +89,15 @@
8889
(> row 2))
8990
[0 -10.35 8.64]
9091
[0 -4.35 8.64])
92+
switch-type (get c :configuration-switch-type)
9193
column-angle (* beta (- 2 column))
9294
placed-shape (->> shape
93-
(translate [0 0 (- (frow-radius alpha))])
95+
(translate [0 0 (- (frow-radius alpha switch-type))])
9496
(rotate (* alpha (- 2 row)) [1 0 0])
95-
(translate [0 0 (frow-radius alpha)])
96-
(translate [0 0 (- (fcolumn-radius beta))])
97+
(translate [0 0 (frow-radius alpha switch-type)])
98+
(translate [0 0 (- (fcolumn-radius beta switch-type))])
9799
(rotate column-angle [0 1 0])
98-
(translate [0 0 (fcolumn-radius beta)])
100+
(translate [0 0 (fcolumn-radius beta switch-type)])
99101
(translate column-offset))]
100102
(->> placed-shape
101103
(rotate tenting-angle [0 1 0])

0 commit comments

Comments
 (0)