twiddling 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.mdl_rules.rb +2 -0
- data/.mdlrc +2 -0
- data/.quiet_quality.yml +9 -0
- data/.rspec +1 -0
- data/.rubocop.yml +21 -0
- data/.standard.yml +3 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +116 -0
- data/bin/cfg2tw7 +13 -0
- data/bin/tw72cfg +9 -0
- data/bin/twiddling +9 -0
- data/configs/v7/default.cfg +0 -0
- data/configs/v7/default.tw7 +168 -0
- data/configs/v7/ericspace2.cfg +0 -0
- data/configs/v7/ericspace2.tw7 +203 -0
- data/fixtures/v7/README.md +31 -0
- data/fixtures/v7/button-mode-keyboard.cfg +0 -0
- data/fixtures/v7/button-mode-keyboard.tw7 +16 -0
- data/fixtures/v7/cycle-config-chord.cfg +0 -0
- data/fixtures/v7/cycle-config-chord.tw7 +12 -0
- data/fixtures/v7/empty.cfg +0 -0
- data/fixtures/v7/empty.tw7 +10 -0
- data/fixtures/v7/haptic-feedback-off.cfg +0 -0
- data/fixtures/v7/haptic-feedback-off.tw7 +16 -0
- data/fixtures/v7/idle-time-8m.cfg +0 -0
- data/fixtures/v7/idle-time-8m.tw7 +12 -0
- data/fixtures/v7/key-repeat-1020.cfg +0 -0
- data/fixtures/v7/key-repeat-1020.tw7 +12 -0
- data/fixtures/v7/key-repeat-disabled.cfg +0 -0
- data/fixtures/v7/key-repeat-disabled.tw7 +12 -0
- data/fixtures/v7/large.cfg +0 -0
- data/fixtures/v7/large.tw7 +142 -0
- data/fixtures/v7/mini-buttons.cfg +0 -0
- data/fixtures/v7/mini-buttons.tw7 +14 -0
- data/fixtures/v7/modifier-key.cfg +0 -0
- data/fixtures/v7/modifier-key.tw7 +12 -0
- data/fixtures/v7/multi-char.cfg +0 -0
- data/fixtures/v7/multi-char.tw7 +12 -0
- data/fixtures/v7/nav-invert-x-axis.cfg +0 -0
- data/fixtures/v7/nav-invert-x-axis.tw7 +16 -0
- data/fixtures/v7/nav-sensitivity-lowered.cfg +0 -0
- data/fixtures/v7/nav-sensitivity-lowered.tw7 +12 -0
- data/fixtures/v7/nav-up-east.cfg +0 -0
- data/fixtures/v7/nav-up-east.tw7 +12 -0
- data/fixtures/v7/no-right-mouse-button.cfg +0 -0
- data/fixtures/v7/no-right-mouse-button.tw7 +12 -0
- data/fixtures/v7/no-t0-dedicated.cfg +0 -0
- data/fixtures/v7/no-t0-dedicated.tw7 +12 -0
- data/fixtures/v7/shifted-key.cfg +0 -0
- data/fixtures/v7/shifted-key.tw7 +12 -0
- data/fixtures/v7/single-unmodified-key.cfg +0 -0
- data/fixtures/v7/single-unmodified-key.tw7 +12 -0
- data/formats/tw7.md +222 -0
- data/formats/v7-cfg.md +272 -0
- data/lib/twiddling/cli/convert.rb +70 -0
- data/lib/twiddling/cli/diff.rb +192 -0
- data/lib/twiddling/cli/help.rb +26 -0
- data/lib/twiddling/cli/read.rb +56 -0
- data/lib/twiddling/cli/search.rb +131 -0
- data/lib/twiddling/cli/twiddling.rb +33 -0
- data/lib/twiddling/cli.rb +8 -0
- data/lib/twiddling/v7/chord.rb +48 -0
- data/lib/twiddling/v7/chord_constants.rb +82 -0
- data/lib/twiddling/v7/config.rb +102 -0
- data/lib/twiddling/v7/config_constants.rb +30 -0
- data/lib/twiddling/v7/data/default_base.cfg +0 -0
- data/lib/twiddling/v7/reader/chord.rb +49 -0
- data/lib/twiddling/v7/reader/config.rb +64 -0
- data/lib/twiddling/v7/reader/settings.rb +26 -0
- data/lib/twiddling/v7/reader/string_table.rb +69 -0
- data/lib/twiddling/v7/settings.rb +21 -0
- data/lib/twiddling/v7/string_table.rb +21 -0
- data/lib/twiddling/v7/string_table_entry.rb +14 -0
- data/lib/twiddling/v7/tw7/button_formatter.rb +63 -0
- data/lib/twiddling/v7/tw7/button_parser.rb +78 -0
- data/lib/twiddling/v7/tw7/effect_formatter.rb +78 -0
- data/lib/twiddling/v7/tw7/effect_parser.rb +121 -0
- data/lib/twiddling/v7/tw7/parser.rb +133 -0
- data/lib/twiddling/v7/tw7/printer.rb +105 -0
- data/lib/twiddling/v7/tw7/settings_formatter.rb +96 -0
- data/lib/twiddling/v7/tw7/settings_parser.rb +97 -0
- data/lib/twiddling/v7/validator.rb +93 -0
- data/lib/twiddling/v7/writer/chord.rb +36 -0
- data/lib/twiddling/v7/writer/config.rb +79 -0
- data/lib/twiddling/v7/writer/settings.rb +19 -0
- data/lib/twiddling/v7/writer/string_table.rb +40 -0
- data/lib/twiddling/v7.rb +34 -0
- data/lib/twiddling/version.rb +3 -0
- data/lib/twiddling.rb +8 -0
- data/tmp/.gitkeep +0 -0
- data/twiddling.gemspec +46 -0
- metadata +284 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
key_repeat: false
|
|
2
|
+
haptic: false
|
|
3
|
+
nav_direction: 1
|
|
4
|
+
t1_modifier: l_command
|
|
5
|
+
t2_modifier: none
|
|
6
|
+
t3_modifier: l_shift
|
|
7
|
+
t4_modifier: none
|
|
8
|
+
f0l_dedicated: none
|
|
9
|
+
f0m_dedicated: none
|
|
10
|
+
f0r_dedicated: none
|
|
11
|
+
t0_dedicated: none
|
|
12
|
+
=====
|
|
13
|
+
1R: backspace
|
|
14
|
+
1M: space
|
|
15
|
+
1L: tab
|
|
16
|
+
2R: i
|
|
17
|
+
1R 2R: 1
|
|
18
|
+
1M 2R: c
|
|
19
|
+
1L 2R: -
|
|
20
|
+
2M: e
|
|
21
|
+
1R 2M: 4
|
|
22
|
+
1M 2M: d
|
|
23
|
+
1L 2M: enter
|
|
24
|
+
2L: o
|
|
25
|
+
1R 2L: 7
|
|
26
|
+
1M 2L: u
|
|
27
|
+
1L 2L: .
|
|
28
|
+
3R: n
|
|
29
|
+
1R 3R: 2
|
|
30
|
+
1M 3R: f
|
|
31
|
+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 3M 4M: =
|
|
82
|
+
4L: s
|
|
83
|
+
1R 4L: 9
|
|
84
|
+
1M 4L: y
|
|
85
|
+
1L 4L: '
|
|
86
|
+
1R 2R 4L: /
|
|
87
|
+
1R 2M 4L: }
|
|
88
|
+
1L 2L 4L: "#"
|
|
89
|
+
1R 3L 4L: ~
|
|
90
|
+
1M 3L 4L: x
|
|
91
|
+
1L 3L 4L: shift+'
|
|
92
|
+
1R 2M 3L 4L: >
|
|
93
|
+
1R 2L 3L 4L: %
|
|
94
|
+
1M 2L 3L 4L: esc
|
|
95
|
+
1L 2L 3L 4L: _
|
|
96
|
+
|
|
97
|
+
T2::
|
|
98
|
+
2R: ctrl+d
|
|
99
|
+
1R 2R: cmd+c
|
|
100
|
+
2M: ctrl+c
|
|
101
|
+
1R 2M: cmd+v
|
|
102
|
+
2L: cmd+n
|
|
103
|
+
1R 2L: cmd+x
|
|
104
|
+
3R: cmd+l
|
|
105
|
+
3M: cmd+k
|
|
106
|
+
3L: cmd+f
|
|
107
|
+
4R: cmd+w
|
|
108
|
+
4M: cmd+t
|
|
109
|
+
4L: cmd+q
|
|
110
|
+
|
|
111
|
+
T4::
|
|
112
|
+
1R: ctrl+y
|
|
113
|
+
1M: up
|
|
114
|
+
1L: page_up
|
|
115
|
+
2R: alt+f
|
|
116
|
+
2M: right
|
|
117
|
+
2L: end
|
|
118
|
+
3R: alt+b
|
|
119
|
+
2R 3R: ctrl+cmd+up
|
|
120
|
+
3M: left
|
|
121
|
+
3L: home
|
|
122
|
+
2L 3L: ctrl+cmd+enter
|
|
123
|
+
4R: ctrl+e
|
|
124
|
+
1R 4R: ctrl+cmd+left
|
|
125
|
+
4M: down
|
|
126
|
+
4L: page_down
|
|
127
|
+
1L 4L: ctrl+cmd+right
|
|
128
|
+
1L 2L 3L 4L: ctrl+cmd+enter
|
|
129
|
+
0L: ctrl+tab
|
|
130
|
+
0M: cmd+`
|
|
131
|
+
0R: cmd+tab
|
|
132
|
+
|
|
133
|
+
T14 4R: speed_cycle
|
|
134
|
+
|
|
135
|
+
[MOUSEMODE]::
|
|
136
|
+
1R: left_click
|
|
137
|
+
1M: middle_click
|
|
138
|
+
1L: right_click
|
|
139
|
+
T23: mouse_toggle
|
|
140
|
+
4R: speed_decrease
|
|
141
|
+
4M: scroll_toggle
|
|
142
|
+
4L: speed_increase
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/formats/tw7.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Twiddler Configuration Text Format (.tw7)
|
|
2
|
+
|
|
3
|
+
A human-readable text format for Twiddler 4 configurations. Can be
|
|
4
|
+
converted to and from the binary `.cfg` format.
|
|
5
|
+
|
|
6
|
+
## File structure
|
|
7
|
+
|
|
8
|
+
A `.tw7` file has two sections separated by a divider line (five or more
|
|
9
|
+
`=` characters). The first section contains settings, the second
|
|
10
|
+
contains chords. If no divider is present, the entire file is chords.
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
idle_time: 480
|
|
14
|
+
key_repeat: false
|
|
15
|
+
=====
|
|
16
|
+
T4 F1M: f
|
|
17
|
+
F1L: backspace
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Comments
|
|
21
|
+
|
|
22
|
+
Lines starting with `#`, or inline `#` after content, are comments.
|
|
23
|
+
Comments are not recognized inside double-quoted strings.
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
# This is a comment
|
|
27
|
+
F1L: backspace # so is this
|
|
28
|
+
F1R: "hello #world" # the # inside quotes is literal
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Settings section
|
|
32
|
+
|
|
33
|
+
Key-value pairs separated by a colon. Settings not specified use the
|
|
34
|
+
defaults from an empty tuner config.
|
|
35
|
+
|
|
36
|
+
### Available settings
|
|
37
|
+
|
|
38
|
+
| Name | Type | Default | Description |
|
|
39
|
+
|------|------|---------|-------------|
|
|
40
|
+
| idle_time | integer | 600 | Seconds until sleep |
|
|
41
|
+
| key_repeat | boolean | true | Key repeat enabled |
|
|
42
|
+
| key_repeat_delay | integer | 100 | Repeat threshold (10ms units) |
|
|
43
|
+
| haptic | boolean | true | Haptic feedback enabled |
|
|
44
|
+
| keyboard_mode | boolean | false | Button mode: keyboard |
|
|
45
|
+
| nav_sensitivity | integer | 4 | Navigation sensitivity (0-31) |
|
|
46
|
+
| nav_invert_x | boolean | false | Invert X axis |
|
|
47
|
+
| nav_direction | integer | 0 | Nav-up direction (0=N, 1=E, ...) |
|
|
48
|
+
|
|
49
|
+
### Thumb modifier assignments
|
|
50
|
+
|
|
51
|
+
| Name | Type | Default | Description |
|
|
52
|
+
|------|------|---------|-------------|
|
|
53
|
+
| t1_modifier | string | none | T1 modifier (see below) |
|
|
54
|
+
| t2_modifier | string | l_option | T2 modifier |
|
|
55
|
+
| t3_modifier | string | l_control | T3 modifier |
|
|
56
|
+
| t4_modifier | string | l_shift | T4 modifier |
|
|
57
|
+
|
|
58
|
+
Modifier values: none, l_control, l_shift, l_option, l_command.
|
|
59
|
+
|
|
60
|
+
### Dedicated button functions
|
|
61
|
+
|
|
62
|
+
| Name | Type | Default | Description |
|
|
63
|
+
|------|------|---------|-------------|
|
|
64
|
+
| f0l_dedicated | string | mouse_right | F0L dedicated function |
|
|
65
|
+
| f0m_dedicated | string | mouse_middle | F0M dedicated function |
|
|
66
|
+
| f0r_dedicated | string | mouse_left | F0R dedicated function |
|
|
67
|
+
| t0_dedicated | string | mouse_left | T0 dedicated function |
|
|
68
|
+
|
|
69
|
+
Dedicated function values: none, mouse_left, mouse_right, mouse_middle.
|
|
70
|
+
|
|
71
|
+
## Chords section
|
|
72
|
+
|
|
73
|
+
Each chord maps a button combination to an effect (key, modifier+key,
|
|
74
|
+
device function, or string).
|
|
75
|
+
|
|
76
|
+
### Basic chords
|
|
77
|
+
|
|
78
|
+
A chord is a button combination followed by a colon and an effect:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
F1R: c
|
|
82
|
+
F1M: space
|
|
83
|
+
T14 F4L: tab
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Button notation
|
|
87
|
+
|
|
88
|
+
Buttons use T4 chord notation. The `T` or `F` prefix is optional for
|
|
89
|
+
finger buttons - `4L` is equivalent to `F4L`. Button names are
|
|
90
|
+
case-insensitive.
|
|
91
|
+
|
|
92
|
+
| Type | Syntax | Examples |
|
|
93
|
+
|------|--------|---------|
|
|
94
|
+
| Thumb | T followed by digits | T1, T14, T234 |
|
|
95
|
+
| Finger | F followed by row and columns | F1R, F2LR, F0M |
|
|
96
|
+
| Finger (short) | Row and columns only | 1R, 2LR, 0M |
|
|
97
|
+
|
|
98
|
+
Multiple buttons in a chord are space-separated:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
T4 F1M: up
|
|
102
|
+
F1L F2L: 1
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Buttons within the same row can be combined:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
F1LR: = # F1L and F1R together
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Effects
|
|
112
|
+
|
|
113
|
+
| Type | Syntax | Examples |
|
|
114
|
+
|------|--------|---------|
|
|
115
|
+
| Key | key name | c, space, enter, f1 |
|
|
116
|
+
| Shifted | shifted symbol | @, !, # |
|
|
117
|
+
| Modified | modifier+key | ctrl+c, cmd+shift+a |
|
|
118
|
+
| String | double-quoted | "the ", "hello" |
|
|
119
|
+
| Device function | function name | speed_cycle, left_click |
|
|
120
|
+
|
|
121
|
+
#### Key names
|
|
122
|
+
|
|
123
|
+
Letters (a-z), digits (0-9), and symbols (-, =, [, ], \, ;, ', `,
|
|
124
|
+
comma, ., /). Special keys: enter, esc, backspace, tab, space, delete,
|
|
125
|
+
insert, home, end, page_up, page_down, up, down, left, right,
|
|
126
|
+
caps_lock, num_lock, f1-f12.
|
|
127
|
+
|
|
128
|
+
Shifted symbols can be used directly: @, !, #, $, %, ^, &, *, (, ),
|
|
129
|
+
\_, +, {, }, |, :, ", ~, <, >, ?.
|
|
130
|
+
|
|
131
|
+
#### Modifiers
|
|
132
|
+
|
|
133
|
+
ctrl, alt, cmd, shift - combined with `+`:
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
F1R: ctrl+c
|
|
137
|
+
F2L: cmd+shift+a
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### Device functions
|
|
141
|
+
|
|
142
|
+
| Name | Description |
|
|
143
|
+
|-----------------|----------------------|
|
|
144
|
+
| mouse_toggle | Toggle mouse mode |
|
|
145
|
+
| left_click | Left mouse click |
|
|
146
|
+
| middle_click | Middle mouse click |
|
|
147
|
+
| right_click | Right mouse click |
|
|
148
|
+
| scroll_toggle | Toggle scroll mode |
|
|
149
|
+
| speed_cycle | Cycle mouse speed |
|
|
150
|
+
| speed_increase | Increase mouse speed |
|
|
151
|
+
| speed_decrease | Decrease mouse speed |
|
|
152
|
+
| print_stats | Print device stats |
|
|
153
|
+
| config_cycle | Cycle configuration |
|
|
154
|
+
|
|
155
|
+
#### Strings
|
|
156
|
+
|
|
157
|
+
Double-quoted strings produce multi-character output. Characters inside
|
|
158
|
+
are typed as a sequence of keypresses:
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
F3L: "the "
|
|
162
|
+
F3M: "ing "
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Uppercase letters in strings are automatically shifted. The `#`
|
|
166
|
+
character inside quotes is literal, not a comment.
|
|
167
|
+
|
|
168
|
+
### Grouping
|
|
169
|
+
|
|
170
|
+
A button combination followed by `::` (double colon) starts a group.
|
|
171
|
+
Indented chords below it are unioned with the group's buttons:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
T1::
|
|
175
|
+
F1M: space
|
|
176
|
+
F2M: "hello"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
This is equivalent to:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
T1 F1M: space
|
|
183
|
+
T1 F2M: "hello"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Groups do not nest. A group ends when a non-indented line is
|
|
187
|
+
encountered.
|
|
188
|
+
|
|
189
|
+
### Grouping on output
|
|
190
|
+
|
|
191
|
+
When converting a binary config to `.tw7`, chords are grouped by thumb
|
|
192
|
+
button combination: first chords with no thumb buttons, then T1, T2,
|
|
193
|
+
T3, T4, T12, T13, etc.
|
|
194
|
+
|
|
195
|
+
## Example
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
idle_time: 480
|
|
199
|
+
haptic: false
|
|
200
|
+
t1_modifier: l_command
|
|
201
|
+
=====
|
|
202
|
+
# Single-finger keys
|
|
203
|
+
F1L: backspace
|
|
204
|
+
F1M: space
|
|
205
|
+
F1R: tab
|
|
206
|
+
|
|
207
|
+
# Two-finger combinations
|
|
208
|
+
F1L F2L: 1
|
|
209
|
+
F1M F2L: c
|
|
210
|
+
|
|
211
|
+
# Thumb-modified groups
|
|
212
|
+
T1::
|
|
213
|
+
F1M: enter
|
|
214
|
+
F2M: "the "
|
|
215
|
+
|
|
216
|
+
T4::
|
|
217
|
+
F1M: up
|
|
218
|
+
F1R: page_up
|
|
219
|
+
|
|
220
|
+
# Device functions
|
|
221
|
+
T14 F4L: speed_cycle
|
|
222
|
+
```
|