-
Notifications
You must be signed in to change notification settings - Fork 3
/
karabiner.edn
157 lines (138 loc) · 5.15 KB
/
karabiner.edn
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
;; note: super key is cmd + ctrl + opt (CTO/QWE); we can't use fn because that isn't recognized as a modifier key on macOS apps
{
:devices {
:macbook-keyboard [{:vendor_id 0 :product_id 0}]
:moonlander [{:vendor_id 12951 :product_id 6505}]
}
:main, [
{:des "Configure modifier keys on macbook keyboard" :rules [
;; fn -> super
[:##fn :!TOleft_command :macbook-keyboard]
;; left control -> left control
[:##left_control :left_control :macbook-keyboard]
;; left option -> left command
[:##left_option :left_command :macbook-keyboard]
;; left command -> left option
[:##left_command :left_option :macbook-keyboard]
;; right command -> right option
[:##right_command :right_option :macbook-keyboard]
;; right option -> right command
[:##right_option :right_command :macbook-keyboard]
;; left arrow -> right control
[:##left_arrow :right_control :macbook-keyboard]
;; up arrow -> super
[:##up_arrow :!TOleft_command :macbook-keyboard]
;; down arrow -> super
[:##down_arrow :!TOleft_command :macbook-keyboard]
;; right arrow -> fn
{
:from {:key_code :right_arrow}
:to [{:apple_vendor_top_case_key_code :keyboard_fn}]
:conditions [{
:identifiers [{:vendor_id 0 :product_id 0}]
:type :device_if
}]
:type :basic
}
;; right shift -> left shift
[:##right_shift :left_shift]
]}
{:des "Swap caps lock to backspace on macbook keyboard" :rules [
[:##caps_lock :delete_or_backspace :macbook-keyboard]
[:##delete_or_backspace :caps_lock :macbook-keyboard]
]}
{:des "Arrow keys on MacBook keyboard" :rules [
;; fn + esdf -> arrow keys
[:!F##e :up_arrow :macbook-keyboard]
[:!F##s :left_arrow :macbook-keyboard]
[:!F##d :down_arrow :macbook-keyboard]
[:!F##f :right_arrow :macbook-keyboard]
]}
{:des "Remap layout to Programmer Dvorak on MacBook Keyboard" :rules [
;; numbers row
[:!Sgrave_accent_and_tilde [:!Sgrave_accent_and_tilde :vk_none] :macbook-keyboard {:held :!Sgrave_accent_and_tilde}]
[:##grave_accent_and_tilde :!S4 :macbook-keyboard]
[:!S1 :!S5 :macbook-keyboard]
[:##1 :!S7 :macbook-keyboard]
[:!S2 :7 :macbook-keyboard]
[:##2 [:open_bracket :vk_none] :macbook-keyboard {:held :open_bracket}]
[:!S3 :5 :macbook-keyboard]
[:##3 [:!Sopen_bracket :vk_none] :macbook-keyboard {:held :!Sopen_bracket}]
[:!S4 :3 :macbook-keyboard]
[:##4 [:!Sclose_bracket :vk_none] :macbook-keyboard {:held :!Sclose_bracket}]
[:!S5 :1 :macbook-keyboard]
[:##5 :!S9 :macbook-keyboard]
[:!S6 :9 :macbook-keyboard]
[:##6 [:equal_sign :vk_none] :macbook-keyboard {:held :equal_sign}]
[:!S7, :0 :macbook-keyboard]
[:##7 :!S8 :macbook-keyboard]
[:!S8, :2 :macbook-keyboard]
[:##8 :!S0 :macbook-keyboard]
[:!S9 :4 :macbook-keyboard]
[:##9 [:!Sequal_sign :vk_none] :macbook-keyboard {:held :equal_sign}]
[:!S0 :6 :macbook-keyboard]
[:##0 [:close_bracket :vk_none] :macbook-keyboard {:held :close_bracket}]
[:!Shyphen :8 :macbook-keyboard]
[:##hyphen :!S1 :macbook-keyboard]
[:!Sequal_sign :!S3 :macbook-keyboard]
[:##equal_sign :grave_accent_and_tilde :macbook-keyboard]
;; top row
[:##q :semicolon :macbook-keyboard]
[:##w :comma :macbook-keyboard]
[:##e :period :macbook-keyboard]
[:##r :p :macbook-keyboard]
[:##t :y :macbook-keyboard]
[:##y :f :macbook-keyboard]
[:##u :g :macbook-keyboard]
[:##i :c :macbook-keyboard]
[:##o :r :macbook-keyboard]
[:##p :l :macbook-keyboard]
[:##open_bracket :slash :macbook-keyboard]
[:!Sclose_bracket :!S6 :macbook-keyboard]
[:##close_bracket :!S2 :macbook-keyboard]
;; home row
[:##a :a :macbook-keyboard]
[:##s :o :macbook-keyboard]
[:##d :e :macbook-keyboard]
[:##f :u :macbook-keyboard]
[:##g :i :macbook-keyboard]
[:##h :d :macbook-keyboard]
[:##j :h :macbook-keyboard]
[:##k :t :macbook-keyboard]
[:##l :n :macbook-keyboard]
[:##semicolon :s :macbook-keyboard]
[:##quote :hyphen :macbook-keyboard]
;; bottom row
[:##z :quote :macbook-keyboard]
[:##x :q :macbook-keyboard]
[:##v :k :macbook-keyboard]
[:##c :j :macbook-keyboard]
[:##b :x :macbook-keyboard]
[:##n :b :macbook-keyboard]
[:##m :m :macbook-keyboard]
[:##comma :w :macbook-keyboard]
[:##period :v :macbook-keyboard]
[:##slash :z :macbook-keyboard]
]}
;; To prevent Shift from affecting numbers, our Moonlander's numbers are
;; mapped to the numpad equivalents instead. However, this causes applications
;; to sometimes use the numpad key (e.g. when setting keyboard shortcuts) instead
;; of the normal number key, causing it to be incompatible with our normal MacBook keyboard.
;; To avoid this issue, we remap the numpad keys to their correct number keys on the Moonlander
{:des "Remap Moonlander's numbers row (numpad keys) to correct keys" :rules [
[:!Skeypad_1 :1 :moonlander]
[:!Skeypad_2 :2 :moonlander]
[:!Skeypad_3 :3 :moonlander]
[:!Skeypad_4 :4 :moonlander]
[:!Skeypad_5 :5 :moonlander]
[:!Skeypad_6 :6 :moonlander]
[:!Skeypad_7 :7 :moonlander]
[:!Skeypad_8 :8 :moonlander]
[:!Skeypad_9 :9 :moonlander]
[:!Skeypad_0 :0 :moonlander]
]}
{:des "F22 to Fn key", :rules [
[:##f22, :fn]
]}
]
}