Skip to content

Commit 79b47ed

Browse files
authored
Merge pull request #64 from happysalada/add_thumb_cluster_offsets
add thumb cluster offsets
2 parents 22b9e83 + e872e3b commit 79b47ed

File tree

4 files changed

+64
-8
lines changed

4 files changed

+64
-8
lines changed

resources/manuform.html

+35
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,41 @@ <h3>Form of the Case</h3>
194194
<option value="false">No</option>
195195
<option value="true">Yes</option>
196196
</select>
197+
<label for="form.thumb-offsets"
198+
>Thumb cluster offsets</label
199+
>
200+
<div class="row" id="form.thumb-offsets">
201+
<div class="column column-33">
202+
<label for="form.thumb-offset-x">X (toward the pinky)</label>
203+
<input
204+
type="number"
205+
name="form.thumb-offset-x"
206+
id="form.thumb-offset-x"
207+
value="6"
208+
step="0.1"
209+
/>
210+
</div>
211+
<div class="column column-33">
212+
<label for="form.thumb-offset-y">Y (toward the index)</label>
213+
<input
214+
type="number"
215+
name="form.thumb-offset-y"
216+
id="form.thumb-offset-y"
217+
value="-3"
218+
step="0.1"
219+
/>
220+
</div>
221+
<div class="column column-33">
222+
<label for="form.thumb-offset-z">Z (altitude)</label>
223+
<input
224+
type="number"
225+
name="form.thumb-offset-z"
226+
id="form.thumb-offset-z"
227+
value="7"
228+
step="0.1"
229+
/>
230+
</div>
231+
</div>
197232
<label for="form.stagger">Stagger?</label>
198233
<select id="form.stagger" name="form.stagger">
199234
<option value="true">Yes</option>

src/dactyl_keyboard/generator.clj

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
:trrs (get confs :configuration-use-trrs?)
3333
:micro-usb (get confs :configuration-use-promicro-usb-hole?)}
3434
:form {:hotswap (get confs :configuration-use-hotswap?)
35+
:thumb-offset-x (get confs :configuration-thumb-offset-x)
36+
:thumb-offset-y (get confs :configuration-thumb-offset-y)
37+
:thumb-offset-z (get confs :configuration-thumb-offset-z)
3538
:stagger (get confs :configuration-stagger?)
3639
:stagger-index-y (second stagger-index)
3740
:stagger-index-z (last stagger-index)

src/dactyl_keyboard/handler.clj

+12
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
param-wide-pinky (parse-bool (get p "form.wide-pinky"))
8787
param-wire-post (parse-bool (get p "form.wire-post"))
8888
param-screw-inserts (parse-bool (get p "form.screw-inserts"))
89+
param-thumb-offset-x (parse-float (get p "form.thumb-offset-x"))
90+
param-thumb-offset-y (parse-float (get p "form.thumb-offset-y"))
91+
param-thumb-offset-z (parse-float (get p "form.thumb-offset-z"))
8992
param-index-y (parse-float (get p "form.stagger-index-y"))
9093
param-index-z (parse-float (get p "form.stagger-index-z"))
9194
param-middle-y (parse-float (get p "form.stagger-middle-y"))
@@ -130,6 +133,9 @@
130133
:configuration-use-promicro-usb-hole? param-use-promicro-usb-hole
131134

132135
:configuration-use-hotswap? param-hotswap
136+
:configuration-thumb-offset-x param-thumb-offset-x
137+
:configuration-thumb-offset-y param-thumb-offset-y
138+
:configuration-thumb-offset-z param-thumb-offset-z
133139
:configuration-stagger? param-stagger
134140
:configuration-stagger-index stagger-index
135141
:configuration-stagger-middle stagger-middle
@@ -253,6 +259,9 @@
253259
curve (get body :curve)
254260
connector (get body :connector)
255261
form (get body :form)
262+
thumb-x (get form :thumb-offset-x 6)
263+
thumb-y (get form :thumb-offset-y -3)
264+
thumb-z (get form :thumb-offset-z 7)
256265
index-y (get form :stagger-index-y 0)
257266
index-z (get form :stagger-index-z 0)
258267
middle-y (get form :stagger-middle-y 2.8)
@@ -285,6 +294,9 @@
285294
:configuration-use-trrs? (get connector :trrs false)
286295
:configuration-use-promicro-usb-hole? (get connector :micro-usb false)
287296

297+
:configuration-thumb-offset-x thumb-x
298+
:configuration-thumb-offset-y thumb-y
299+
:configuration-thumb-offset-z thumb-z
288300
:configuration-use-hotswap? (get form :hotswap false)
289301
:configuration-stagger? (get form :stagger true)
290302
:configuration-stagger-index stagger-index

src/dactyl_keyboard/manuform.clj

+14-8
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
[dactyl-keyboard.common :refer :all]))
77

88
(def column-style :standard)
9-
; it dictates the location of the thumb cluster.
10-
; the first member of the vector is x axis, second one y axis,
11-
; while the last one is y axis.
12-
; the higher x axis value is, the closer it to the pinky.
13-
; the higher y axis value is, the closer it to the alphas.
14-
; the higher z axis value is, the higher it is.
15-
(def thumb-offsets [6 -3 7])
169

1710
; controls overall height; original=9 with centercol=3; use 16 for centercol=2
1811
;(def keyboard-z-offset 4)
@@ -277,14 +270,27 @@
277270
;; Thumbs ;;
278271
;;;;;;;;;;;;
279272

273+
; it dictates the location of the thumb cluster.
274+
; the first member of the vector is x axis, second one y axis,
275+
; while the last one is y axis.
276+
; the higher x axis value is, the closer it to the pinky.
277+
; the higher y axis value is, the closer it to the alphas.
278+
; the higher z axis value is, the higher it is.
279+
(defn thumb-offsets [c]
280+
(let [x-offset (get c :configuration-thumb-offset-x)
281+
y-offset (get c :configuration-thumb-offset-y)
282+
z-offset (get c :configuration-thumb-offset-z)]
283+
[x-offset y-offset z-offset ]))
284+
285+
280286
; this is where the original position of the thumb switches defined.
281287
; each and every thumb keys is derived from this value.
282288
; the value itself is defined from the 'm' key's position in qwerty layout
283289
; and then added by some values, including thumb-offsets above.
284290
(defn thumborigin [c]
285291
(let [cornerrow (fcornerrow (get c :configuration-nrows))]
286292
(map + (key-position c 1 cornerrow [(/ mount-width 2) (- (/ mount-height 2)) 0])
287-
thumb-offsets)))
293+
(thumb-offsets c))))
288294

289295
(defn thumb-tr-place [c shape]
290296
(let [thumb-count (get c :configuration-thumb-count)

0 commit comments

Comments
 (0)