-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjoy2chord-config
294 lines (269 loc) · 7.46 KB
/
joy2chord-config
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
# Why a 6 button controller as the default config?
#
# Default Config File for joy2chord by Nathanael Anderson
# wir ele ssdr eamer A@T gmail D0T com
#
# 1. Thats what I built, so the config is made and tested
# 2. One button for each finger, 2 for the thumb, fingers don't
# have to move very far at all.
# 3. 63 combinations per mode, I used 3 modes, define whatever you want
# for each, I started with 5 buttons and 32 combinations, but I had
# to change modes too often with this setup, so i added a 6th button
#
# Why A Joystick as a Chorded Keyboard?
#
# Gamepads and joysticks are dirt cheap, chorded keyboards ... usually aren't
# I wanted to play around with this for a while, so if its useful to you,
# enjoy, if not ignore it :)
#
#
# Basic Config Options
jsdev = 0 # if device hooked up to /dev/input/js0 set jsdev = 0
# to find out button numbers use the jstest utility
total_simple_buttons = 0 # no simple buttons are defined in this config, so this is set to 0
# use simple_b1, and increment for every button you use, map buttons to the joystick code they send
# a simple button is not part of a chord, and is held down untill released
# in 1simple2 1 stands for the current mode, and 2 for the
simple_b1 = 5
simple_b2 = 7
1simple1 = KEY_A
1simple2 = KEY_B
2simple1 = KEY_C
2simple2 = KEY_D
3simple1 = KEY_E
3simple2 = KEY_F
total_chorded_buttons = 6 # The hardware used may provide more buttons than we use, so only cycle through as many as we use
# use joy_b0, and increment for every button you use, map buttons to the joystick code they send
# these are assigned binary number combinations so
# b1 is worth 1
# b2 is worth 2
# b3 is worth 4
# b4 is worth 8
# b5 is worth 16
# b6 is worth 32
# so if b2 and b5 are pressed, the current value is 18, whenever a button is pressed, what it is worth is added to the total value of the chord, so if the chorded keyboard is in mode 1 and buttons 2 + 5 are pressed, the chord total is 18, if all buttons are released mode 1 value 18 is sent, which in the default config would map to the letter r.
# to find out button numbers use the jstest utility
chord_b1 = 4
chord_b2 = 6
chord_b3 = 9
chord_b4 = 3
chord_b5 = 5
chord_b6 = 7
# How many modes do you want to define
total_modes = 3 # How many modes do you want to define
total_macros = 4 # macros are not implemented yet
total_modifiers = 4 # a modifier is activated until a non modifier is pressed
1modifier = KEY_LEFTMETA
2modifier = KEY_LEFTCTRL
3modifier = KEY_LEFTALT
4modifier = KEY_LEFTSHIFT
# what key combinations toggle modes
# Examples:
# on a 6 button controller pressing buttons
# 1modecode = 31
# 1,2,3,4,5 = 1+2+4+8+16 = 31
# 2modecode = 47
# 1,2,3,4,6 = 1+2+4+8+32 = 47
# 3modecode = 63
# 1,2,3,4,5,6 = 1+2+4+8+16+32 = 63
1modecode = 31
2modecode = 47
3modecode = 63
# all valid codes come from /usr/include/linux/input.h
# Mode One options ( form of 1chord# )
# the leading number 1 in this case signifies the mode
# the trailing number is the binary number combination the chorded buttons equal
# so for 1chord10 if you have 4 buttons, the 2nd and 4th would be pressed down
# as 2 + 8 = 10
# unused keys should be set to KEY_RESERVED so warnings are not given about undefined values
1chord1 = KEY_A
1chord2 = KEY_B
1chord3 = KEY_C
1chord4 = KEY_D
1chord5 = KEY_E
1chord6 = KEY_F
1chord7 = KEY_G
1chord8 = KEY_H
1chord9 = KEY_I
1chord10 = KEY_J
1chord11 = KEY_K
1chord12 = KEY_L
1chord13 = KEY_M
1chord14 = KEY_N
1chord15 = KEY_O
1chord16 = KEY_P
1chord17 = KEY_Q
1chord18 = KEY_R
1chord19 = KEY_S
1chord20 = KEY_T
1chord21 = KEY_U
1chord22 = KEY_V
1chord23 = KEY_W
1chord24 = KEY_X
1chord25 = KEY_Y
1chord26 = KEY_Z
1chord27 = KEY_LEFTSHIFT
1chord28 = KEY_LEFTMETA
1chord29 = KEY_LEFTCTRL
1chord30 = KEY_LEFTALT
1chord31 = KEY_RESERVED # using for mode one
1chord32 = KEY_ENTER
1chord33 = KEY_SPACE
1chord34 = KEY_TAB
1chord35 = KEY_BACKSPACE
1chord36 = KEY_RESERVED
1chord37 = KEY_RESERVED
1chord38 = KEY_RESERVED
1chord39 = KEY_RESERVED
1chord40 = KEY_ESC
1chord41 = KEY_PAGEUP
1chord42 = KEY_PAGEDOWN
1chord43 = KEY_HOME
1chord44 = KEY_END
1chord45 = KEY_INSERT
1chord46 = KEY_DELETE
1chord47 = KEY_RESERVED #using for mode two
1chord48 = KEY_RESERVED
1chord49 = KEY_RESERVED
1chord50 = KEY_RESERVED
1chord51 = KEY_RESERVED
1chord52 = KEY_RESERVED
1chord53 = KEY_RESERVED
1chord54 = KEY_RESERVED
1chord55 = KEY_RESERVED
1chord56 = KEY_RESERVED
1chord57 = KEY_RESERVED
1chord58 = KEY_RESERVED
1chord59 = KEY_RESERVED
1chord60 = KEY_RESERVED
1chord61 = KEY_RESERVED
1chord62 = KEY_RESERVED
1chord63 = KEY_RESERVED # using for mode two
# Mode Two options ( form of 2chord# )
2chord1 = KEY_1
2chord2 = KEY_2
2chord3 = KEY_3
2chord4 = KEY_4
2chord5 = KEY_5
2chord6 = KEY_6
2chord7 = KEY_7
2chord8 = KEY_8
2chord9 = KEY_9
2chord10 = KEY_0
2chord11 = KEY_RESERVED
2chord12 = KEY_RESERVED
2chord13 = KEY_RESERVED
2chord14 = KEY_RESERVED
2chord15 = KEY_RESERVED
2chord16 = KEY_RESERVED
2chord17 = KEY_RESERVED
2chord18 = KEY_RESERVED
2chord19 = KEY_RESERVED
2chord20 = KEY_RESERVED
2chord21 = KEY_LEFTBRACE
2chord22 = KEY_RIGHTBRACE
2chord23 = KEY_RESERVED
2chord24 = KEY_RESERVED
2chord25 = KEY_RESERVED
2chord26 = KEY_RESERVED
2chord27 = KEY_LEFTSHIFT
2chord28 = KEY_LEFTMETA
2chord29 = KEY_LEFTCTRL
2chord30 = KEY_LEFTALT
2chord31 = KEY_RESERVED # using for mode one
2chord32 = KEY_ENTER
2chord33 = KEY_SPACE
2chord34 = KEY_TAB
2chord35 = KEY_BACKSPACE
2chord36 = KEY_RESERVED
2chord37 = KEY_RESERVED
2chord38 = KEY_RESERVED
2chord39 = KEY_RESERVED
2chord40 = KEY_ESC
2chord41 = KEY_RESERVED
2chord42 = KEY_RESERVED
2chord43 = KEY_HOME
2chord44 = KEY_END
2chord45 = KEY_INSERT
2chord46 = KEY_DELETE
2chord47 = KEY_RESERVED # using for mode two
2chord48 = KEY_RESERVED
2chord49 = KEY_RESERVED
2chord50 = KEY_RESERVED
2chord51 = KEY_RESERVED
2chord52 = KEY_RESERVED
2chord53 = KEY_RESERVED
2chord54 = KEY_RESERVED
2chord55 = KEY_RESERVED
2chord56 = KEY_RESERVED
2chord57 = KEY_RESERVED
2chord58 = KEY_RESERVED
2chord59 = KEY_RESERVED
2chord60 = KEY_RESERVED
2chord61 = KEY_RESERVED
2chord62 = KEY_RESERVED
2chord63 = KEY_RESERVED # using for mode two
# Mode Three options ( form of 3chord# )
3chord1 = KEY_UP
3chord2 = KEY_LEFT
3chord3 = KEY_PAGEUP
3chord4 = KEY_RIGHT
3chord5 = KEY_RESERVED
3chord6 = KEY_RESERVED
3chord7 = KEY_RESERVED
3chord8 = KEY_DOWN
3chord9 = KEY_RESERVED
3chord10 = KEY_RESERVED
3chord11 = KEY_RESERVED
3chord12 = KEY_PAGEDOWN
3chord13 = KEY_RESERVED
3chord14 = KEY_RESERVED
3chord15 = KEY_RESERVED
3chord16 = KEY_RESERVED
3chord17 = KEY_RESERVED
3chord18 = KEY_RESERVED
3chord19 = KEY_RESERVED
3chord20 = KEY_RESERVED
3chord21 = KEY_RESERVED
3chord22 = KEY_RESERVED
3chord23 = KEY_RESERVED
3chord24 = KEY_RESERVED
3chord25 = KEY_RESERVED
3chord26 = KEY_RESERVED
3chord27 = KEY_LEFTSHIFT
3chord28 = KEY_LEFTMETA
3chord29 = KEY_LEFTCTRL
3chord30 = KEY_LEFTALT
3chord31 = KEY_RESERVED # using for mode one
3chord32 = KEY_ENTER
3chord33 = KEY_F1
3chord34 = KEY_F2
3chord35 = KEY_F3
3chord36 = KEY_F4
3chord37 = KEY_F5
3chord38 = KEY_F6
3chord39 = KEY_F7
3chord40 = KEY_F8
3chord41 = KEY_F9
3chord42 = KEY_F10
3chord43 = KEY_F11
3chord44 = KEY_F12
3chord45 = KEY_RESERVED
3chord46 = KEY_RESERVED
3chord47 = KEY_RESERVED # using for mode two
3chord48 = KEY_RESERVED
3chord49 = KEY_RESERVED
3chord50 = KEY_RESERVED
3chord51 = KEY_RESERVED
3chord52 = KEY_RESERVED
3chord53 = KEY_RESERVED
3chord54 = KEY_RESERVED
3chord55 = KEY_RESERVED
3chord56 = KEY_RESERVED
3chord57 = KEY_SYSRQ
3chord58 = KEY_BREAK
3chord59 = KEY_PAUSE
3chord60 = KEY_CAPSLOCK
3chord61 = KEY_NUMLOCK
3chord62 = KEY_SCROLLLOCK
3chord63 = KEY_RESERVED # using for mode three