-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.kbd
332 lines (263 loc) · 10.7 KB
/
example.kbd
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#|
--------------------------------------------------------------------------
Copyright Copyright 2022 Frank David Martinez Muñoz (aka @mnesarco)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--------------------------------------------------------------------------
Example
Split Keyboard with Modified Colemak-DH
--------------------------------------------------------------------------
|#
(defcfg
;; Event source
input (device-file "/dev/input/by-id/usb-split-keyboard-event-kbd")
;; Keyboard generated by KMonad (layers)
output (uinput-sink "Split_Keyboard_KMonad" "/run/current-system/sw/bin/sleep 1 && /run/current-system/sw/bin/setxkbmap -option compose:menu")
;; Set the compose key to `RightAlt'
cmp-seq compose
;; 5ms delay between each compose-key sequence press
cmp-seq-delay 5
;; Comment this is you want unhandled events not to be emitted
fallthrough true
;; Set this to false to disable any command-execution in KMonad
allow-cmd false
)
#|
--------------------------------------------------------------------------
| Keys reported by split layout virtual hardware (qwerty)
| Never used as layer
--------------------------------------------------------------------------
|#
(defsrc
esc f1 f2 f3 f4 f5 ssrq f6 f7 f8 f9 f10
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t ent y u i o p
caps a s d f g home h j k l end
z c v b rsft n . /
ralt
)
#|
--------------------------------------------------------------------------
| Special buttons
--------------------------------------------------------------------------
|#
(defalias
;; Tap: Space, Hold: Layer numbers
_num (tap-hold-next-release 153 spc (tap-next spc (layer-toggle numbers)))
;; Tap: LeftCtrl, Hold: Layer punctuation
_pun (tap-hold-next-release 153 bspc (tap-next bspc (layer-toggle punctuation)))
;; Tap: Tab, Hold: Layer navigation
_nav (tap-hold-next-release 153 tab (tap-next tab (layer-toggle navigation)))
_mac (layer-toggle macros)
;; Special Letters
~n (around ralt n)
til (around ralt *)
;; Clipboard
ccpy C-ins
cpte S-ins
ccut C-x
;; Special keys
ssp (tap-hold-next-release 153 spc (tap-next spc rsft)) ;; Space - Shift
tctl (tap-hold-next-release 153 tab (tap-next tab lctl)) ;; Tab - Ctrl
calt (tap-hold-next-release 153 @ccpy (tap-next @ccpy lalt)) ;; Copy - Alt
)
#|
--------------------------------------------------------------------------
| Default layer
--------------------------------------------------------------------------
|#
(deflayer colemakdhmo
XX f1 f2 f3 f4 f5 ssrq f6 f7 f8 f9 f10
XX XX w f p b XX f11 f12 j l u - grv
@_nav q r s t g bspc m n e i @~n
bspc a c d v z caps @_mac k h y o
x @calt @tctl @_num @ssp @_pun met ent
ralt
)
#|
--------------------------------------------------------------------------
| Numeric layer
--------------------------------------------------------------------------
|#
(defalias
ctp C-p
)
(deflayer numbers
_ @ctp vold volu mute pp _ prev next _ _ _
_ _ _ _ _ _ _ _ _ 7 8 9 _ _
_ _ _ _ _ _ _ _ 4 5 6 _
_ _ _ _ _ _ _ 0 1 2 3 _
_ _ _ _ _ . _ _
,
)
#|
--------------------------------------------------------------------------
| Punctuation layer
--------------------------------------------------------------------------
|#
(defalias
quot S-' ;; Double quote: "
)
(deflayer punctuation
_ _ _ _ _ _ _ _ _ _ _ _
_ ! # $ % & _ _ _ + * ~ - _
_ _ . , ; : _ / \) ] > ?
_ { < [ \( _ _ bksl \_ ^ | }
_ ' @quot = _ _ _ _
_
)
#|
--------------------------------------------------------------------------
| Navigation
--------------------------------------------------------------------------
|#
(defalias
;; Navigation with Ctrl modifier
_nvc (layer-toggle navigation-ctrl)
;; Navigation with Shift-Ctrl modifier
_nsc (layer-toggle navigation-shift-ctrl)
;; Nav/Selection
hom_ (tap-hold-next-release 153 home (tap-hold-next-release 153 home S-home)) ;; Home, Select to home
end_ (tap-hold-next-release 153 end (tap-hold-next-release 153 end S-end)) ;; End, Select to end
lft_ (tap-hold-next-release 153 lft (tap-hold-next-release 153 lft S-C-lft)) ;; Left, Select to left word
rgt_ (tap-hold-next-release 153 rght (tap-hold-next-release 153 rght S-C-rght)) ;; Right, Select to right word
)
(deflayer navigation
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ pgup @hom_ up @end_ ins
_ _ _ _ _ _ _ pgdn @lft_ down @rgt_ del
_ _ _ _ _ @_nsc XX bspc
@_nvc
)
(defalias
cup C-up
cdn C-down
clf C-lft
crg C-rght
chm C-home
ced C-end
)
(deflayer navigation-ctrl
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ @chm @cup @ced _
_ _ _ _ _ _ _ _ @clf @cdn @crg _
_ _ _ _ _ _ _ _
XX
)
(defalias
scup S-C-up
scdn S-C-down
sclf S-C-lft
scrg S-C-rght
schm S-C-home
sced S-C-end
)
(deflayer navigation-shift-ctrl
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ @schm @scup @sced _
_ _ _ _ _ _ _ _ @sclf @scdn @scrg _
_ _ _ _ _ XX _ _
_
)
#|
--------------------------------------------------------------------------
| Macros layer
--------------------------------------------------------------------------
|#
(defalias
mac1 #( I t spc W o r k s ! ! ! ent)
)
(deflayer macros
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ @mac1 _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_
)
#|
--------------------------------------------------------------------------
| Template layer
--------------------------------------------------------------------------
|#
(deflayer template
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_
)
#|
<hardware-layout>
+---------------------------------------------------------------------------------------------------------+
| This section defines how to export this standard KMonad file to http://www.keyboard-layout-editor.com/ |
+---------------------------------------------------------------------------------------------------------+
!!! Keycap layout and colors
----------------------------
(keycap
numbers _ punctuation
_ colemakdhmo _
navigation _ _
_ _ macros
)
(colors
#ff0000 #000000 #256329
#000000 #000000 #000000
#0000ff #000000 #000000
#000000 #000000 #222222
)
!!! Options are based on `defsrc` (a.k.a. Layer 0) keys
-------------------------------------------------------
(options f1 {x:1})
(options ssrq {x:4})
(options f6 {x:1})
(options 7 {x:4})
(options ent {x:4, w:1.5})
(options home {x:4.25, w:1.75})
(options rsft {x:3.75, w:2.25})
(options tab {w:1.5})
(options caps {w:1.75})
(options t {w:1.5})
(options z {x:2.25})
(options c {x:1})
(options . {x:2})
(options ralt {x:13.75})
(options p {w:1.5})
!!! Override or assign labels
-----------------------------
(label @~n ñ)
(label @_nav ⎈ Nav)
(label @_pun Sym)
(label @_num Num Space)
(label @hom_ ↖)
(label @lft_ ←)
(label @rgt_ →)
(label @end_ ↘)
(label @ctp 🔍)
(label @_nsc sh+ctl)
(label @_nvc ctl)
(label @calt Alt Cpy)
(label @quot \")
(label @tctl Ctrl Tab)
(label @ssp Shift / Space)
(label @_mac Macro)
(label @mac1 iw)
!!! Add some notes
------------------
(description
This is a KMonad keyboard layout example to illustrate how to generate
the keyboard layout for visualization at http://www.keyboard-layout-editor.com/
)
</hardware-layout>
|#