Skip to content

Commit

Permalink
fix regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnuda committed Oct 27, 2020
1 parent b382427 commit 22b9e83
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
9 changes: 8 additions & 1 deletion resources/lightcycle.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ <h3>Keys</h3>
<option value="false">No</option>
<option value="true">Yes</option>
</select>
<label for="keys.switch-type">Key Hole</label>
<select id="keys.switch-type" name="keys.switch-type">
<option value="box">Box and MX</option>
<option value="mx">MX</option>
<option value="alps">Alps</option>
<option value="choc">Choc (Experimental)</option>
</select>
</fieldset>
<label for="curve">
<h3>Curvature & Tenting</h3>
Expand Down Expand Up @@ -202,4 +209,4 @@ <h3>Miscelania</h3>
</ul>
</div>
</div>
{% endblock %}
{% endblock %}
1 change: 1 addition & 0 deletions resources/public/lightcycle.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"num-row": false,
"last-row": false,
"thumb-count": "two",
"switch-type": "box",
"hide-last-pinky": false
},
"curve": {
Expand Down
1 change: 1 addition & 0 deletions src/dactyl_keyboard/generator.clj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
{:keys {:columns (get confs :configuration-ncols)
:num-row (get confs :configuration-use-numrow?)
:last-row (get confs :configuration-use-lastrow?)
:switch-type (get confs :configuration-switch-type)
:thumb-count (get confs :configuration-thumb-count)
:hide-last-pinky (get confs :configuration-hide-last-pinky?)}
:curve {:alpha (get confs :configuration-alpha)
Expand Down
11 changes: 9 additions & 2 deletions src/dactyl_keyboard/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"zero" :zero
"full" :full
:two)
switch-type (case (get p "keys.switch-type")
param-switch-type (case (get p "keys.switch-type")
"mx" :mx
"alps" :alps
"choc" :choc
Expand Down Expand Up @@ -113,7 +113,7 @@
:configuration-ncols param-ncols
:configuration-thumb-count param-thumb-count
:configuration-last-row-count param-last-row-count
:configuration-switch-type switch-type
:configuration-switch-type param-switch-type
:configuration-use-inner-column? param-inner-column
:configuration-hide-last-pinky? param-hide-last-pinky

Expand Down Expand Up @@ -170,6 +170,11 @@
"six" :six
"eight" :eight
:five)
param-switch-type (case (get p "keys.switch-type")
"mx" :mx
"alps" :alps
"choc" :choc
:box)
param-hide-last-pinky (parse-bool (get p "keys.hide-last-pinky"))
param-alpha (parse-int (get p "curve.alpha"))
param-beta (parse-int (get p "curve.beta"))
Expand Down Expand Up @@ -205,6 +210,7 @@
:configuration-thumb-count param-thumb-count
:configuration-hide-last-pinky? param-hide-last-pinky
:configuration-use-wide-pinky? param-use-wide-pinky
:configuration-switch-type param-switch-type

:configuration-alpha (if generate-json? param-alpha (/ pi param-alpha))
:configuration-beta (if generate-json? param-beta (/ pi param-beta))
Expand Down Expand Up @@ -307,6 +313,7 @@
c {:configuration-ncols (get keys :columns 5)
:configuration-use-numrow? (get keys :num-row false)
:configuration-use-lastrow? (get keys :last-row false)
:configuration-switch-type (keyword (get keys :switch-type "box"))
:configuration-thumb-count (keyword (get keys :thumb-count "two"))
:configuration-create-side-nub? false
:configuration-use-alps? false
Expand Down
18 changes: 10 additions & 8 deletions src/dactyl_keyboard/lightcycle.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,19 @@
beta (get c :configuration-beta)
tenting-angle (get c :configuration-tenting-angle)
z-offset (get c :configuration-z-offset)
switch-type (get c :configuration-switch-type)
manuform-offset? (get c :configuration-manuform-offset? false)
offset (if manuform-offset?
(manuform-column-offset column)
(column-offset column))
column-angle (* beta (- 2 column))
placed-shape (->> shape
(translate [(wide-pinky c column row) 0 (- (frow-radius alpha))])
(translate [(wide-pinky c column row) 0 (- (frow-radius alpha switch-type))])
(rotate (* alpha (- 2 row)) [1 0 0])
(translate [0 0 (frow-radius alpha)])
(translate [0 0 (- (fcolumn-radius beta))])
(translate [0 0 (frow-radius alpha switch-type)])
(translate [0 0 (- (fcolumn-radius beta switch-type))])
(rotate column-angle [0 1 0])
(translate [0 0 (fcolumn-radius beta)])
(translate [0 0 (fcolumn-radius beta switch-type)])
(translate offset))]
(->> placed-shape
(rotate tenting-angle [0 1 0])
Expand All @@ -88,14 +89,15 @@
(> row 2))
[0 -10.35 8.64]
[0 -4.35 8.64])
switch-type (get c :configuration-switch-type)
column-angle (* beta (- 2 column))
placed-shape (->> shape
(translate [0 0 (- (frow-radius alpha))])
(translate [0 0 (- (frow-radius alpha switch-type))])
(rotate (* alpha (- 2 row)) [1 0 0])
(translate [0 0 (frow-radius alpha)])
(translate [0 0 (- (fcolumn-radius beta))])
(translate [0 0 (frow-radius alpha switch-type)])
(translate [0 0 (- (fcolumn-radius beta switch-type))])
(rotate column-angle [0 1 0])
(translate [0 0 (fcolumn-radius beta)])
(translate [0 0 (fcolumn-radius beta switch-type)])
(translate column-offset))]
(->> placed-shape
(rotate tenting-angle [0 1 0])
Expand Down

0 comments on commit 22b9e83

Please sign in to comment.