fizzctl 0.2.1__tar.gz → 0.4.0__tar.gz

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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: fizzctl
3
- Version: 0.2.1
4
- Summary: Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native RGB effects, per-key painting, live animations, and Cfg.ini keymap restore — no vendor software required
3
+ Version: 0.4.0
4
+ Summary: Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native RGB effects, per-key painting, live animations, on-device key macros, and Cfg.ini keymap restore — no vendor software required
5
5
  Keywords: redragon,k617,fizz,rgb,keyboard,backlight,led,hid,linux
6
6
  Author: Ayoub Dya
7
7
  Author-email: Ayoub Dya <ayoubdya@gmail.com>
@@ -20,8 +20,9 @@ Description-Content-Type: text/markdown
20
20
 
21
21
  # fizzctl
22
22
 
23
- Linux tool for controlling the Redragon K617 Fizz keyboard's RGB lighting
24
- and restoring keymaps from `Cfg.ini` files.
23
+ Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native
24
+ RGB effects, per-key painting, live animations, on-device key macros with a
25
+ readable back, and `Cfg.ini` keymap restore — no vendor software required.
25
26
 
26
27
  ## Install
27
28
 
@@ -59,6 +60,8 @@ the trigger did not pick it up.
59
60
  | `key` | Paint a single key | yes |
60
61
  | `paint` | Paint multiple keys at once | yes |
61
62
  | `keymap` | Write the keymap from a Cfg.ini | yes |
63
+ | `macro` | Bind a key that types text, `--remove-all`, or `--read` | yes |
64
+ | `restore` | Reset to the factory keymap, lighting and macros | yes |
62
65
  | `animate` | Host-streamed animation (volatile) | no |
63
66
 
64
67
  ## Examples
@@ -80,6 +83,39 @@ Apply the full keymap (bindings, lighting zones, function keys) from a
80
83
  fizzctl keymap Cfg.ini
81
84
  ```
82
85
 
86
+ - A `keymap` write keeps your current effect/color/brightness and any macros
87
+ you have bound.
88
+ - `fizzctl restore` does the opposite: it resets the keyboard to factory
89
+ state by writing the packaged stock keymap and lighting and wiping every
90
+ macro.
91
+
92
+ ### Macros
93
+
94
+ Bind a key to a macro that types text. Each macro gets its own slot (up to
95
+ 8), and previously bound macros are kept — the device's current keymap is
96
+ read and reused as the base, and your lighting is untouched:
97
+
98
+ ```bash
99
+ fizzctl macro --key CapsLock rgb # type "rgb" each press
100
+ fizzctl macro --key LAlt --delay-ms 50 --cycles 3 hello
101
+ fizzctl macro --key 2 --until-released aaaa
102
+ ```
103
+
104
+ Options: `--delay-ms` (default 30) is the delay between typed events,
105
+ `--cycles` (default 1) plays the macro that many times per press, and
106
+ `--until-released` types in a loop until the key is let go. Macros are read
107
+ straight back off the keyboard's flash: each write reads the current keymap
108
+ and macro table first, patches them, and writes the full table back — so
109
+ later macro/keymap writes never drop your existing macros, and nothing is
110
+ saved on the host. `fizzctl macro --read` dumps the on-device table back,
111
+ each slot shown with the key(s) bound to it and whether it repeats until the
112
+ key is released. To undo:
113
+
114
+ ```bash
115
+ fizzctl macro --remove-all # unbind every macro, keep keymap + lighting
116
+ fizzctl restore # full factory reset (keymap, lighting, macros)
117
+ ```
118
+
83
119
  ### Set the whole board to one color
84
120
 
85
121
  ```bash
@@ -152,11 +188,11 @@ fizzctl-dev list
152
188
 
153
189
  ## How the RGB paths work
154
190
 
155
- **Flash writes** (`rgb`, `key`, `paint`, `effect`, `keymap`) send a 4-5 frame
156
- burst through the vendor HID interface (`258a:0049`, interface 1, usage page
157
- `0xFF00`). The sequence ends with a `5AA5` magic commit that writes to flash.
158
- Colors persist across reboots. Keys not listed in a `key` or `paint` canvas
159
- turn off.
191
+ **Flash writes** (`rgb`, `key`, `paint`, `effect`, `keymap`, `macro`,
192
+ `restore`) send a burst through the vendor HID interface (`258a:0049`,
193
+ interface 1, usage page `0xFF00`). The sequence ends with a `5AA5` magic
194
+ commit that writes to flash. Colors persist across reboots. Keys not listed
195
+ in a `key` or `paint` canvas turn off.
160
196
 
161
197
  **Animations** (`animate`) stream 382-byte per-key reports at the requested
162
198
  frame rate with no flash commit. They are host-side only and lost on
@@ -1,7 +1,8 @@
1
1
  # fizzctl
2
2
 
3
- Linux tool for controlling the Redragon K617 Fizz keyboard's RGB lighting
4
- and restoring keymaps from `Cfg.ini` files.
3
+ Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native
4
+ RGB effects, per-key painting, live animations, on-device key macros with a
5
+ readable back, and `Cfg.ini` keymap restore — no vendor software required.
5
6
 
6
7
  ## Install
7
8
 
@@ -39,6 +40,8 @@ the trigger did not pick it up.
39
40
  | `key` | Paint a single key | yes |
40
41
  | `paint` | Paint multiple keys at once | yes |
41
42
  | `keymap` | Write the keymap from a Cfg.ini | yes |
43
+ | `macro` | Bind a key that types text, `--remove-all`, or `--read` | yes |
44
+ | `restore` | Reset to the factory keymap, lighting and macros | yes |
42
45
  | `animate` | Host-streamed animation (volatile) | no |
43
46
 
44
47
  ## Examples
@@ -60,6 +63,39 @@ Apply the full keymap (bindings, lighting zones, function keys) from a
60
63
  fizzctl keymap Cfg.ini
61
64
  ```
62
65
 
66
+ - A `keymap` write keeps your current effect/color/brightness and any macros
67
+ you have bound.
68
+ - `fizzctl restore` does the opposite: it resets the keyboard to factory
69
+ state by writing the packaged stock keymap and lighting and wiping every
70
+ macro.
71
+
72
+ ### Macros
73
+
74
+ Bind a key to a macro that types text. Each macro gets its own slot (up to
75
+ 8), and previously bound macros are kept — the device's current keymap is
76
+ read and reused as the base, and your lighting is untouched:
77
+
78
+ ```bash
79
+ fizzctl macro --key CapsLock rgb # type "rgb" each press
80
+ fizzctl macro --key LAlt --delay-ms 50 --cycles 3 hello
81
+ fizzctl macro --key 2 --until-released aaaa
82
+ ```
83
+
84
+ Options: `--delay-ms` (default 30) is the delay between typed events,
85
+ `--cycles` (default 1) plays the macro that many times per press, and
86
+ `--until-released` types in a loop until the key is let go. Macros are read
87
+ straight back off the keyboard's flash: each write reads the current keymap
88
+ and macro table first, patches them, and writes the full table back — so
89
+ later macro/keymap writes never drop your existing macros, and nothing is
90
+ saved on the host. `fizzctl macro --read` dumps the on-device table back,
91
+ each slot shown with the key(s) bound to it and whether it repeats until the
92
+ key is released. To undo:
93
+
94
+ ```bash
95
+ fizzctl macro --remove-all # unbind every macro, keep keymap + lighting
96
+ fizzctl restore # full factory reset (keymap, lighting, macros)
97
+ ```
98
+
63
99
  ### Set the whole board to one color
64
100
 
65
101
  ```bash
@@ -132,11 +168,11 @@ fizzctl-dev list
132
168
 
133
169
  ## How the RGB paths work
134
170
 
135
- **Flash writes** (`rgb`, `key`, `paint`, `effect`, `keymap`) send a 4-5 frame
136
- burst through the vendor HID interface (`258a:0049`, interface 1, usage page
137
- `0xFF00`). The sequence ends with a `5AA5` magic commit that writes to flash.
138
- Colors persist across reboots. Keys not listed in a `key` or `paint` canvas
139
- turn off.
171
+ **Flash writes** (`rgb`, `key`, `paint`, `effect`, `keymap`, `macro`,
172
+ `restore`) send a burst through the vendor HID interface (`258a:0049`,
173
+ interface 1, usage page `0xFF00`). The sequence ends with a `5AA5` magic
174
+ commit that writes to flash. Colors persist across reboots. Keys not listed
175
+ in a `key` or `paint` canvas turn off.
140
176
 
141
177
  **Animations** (`animate`) stream 382-byte per-key reports at the requested
142
178
  frame rate with no flash commit. They are host-side only and lost on
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "fizzctl"
3
- version = "0.2.1"
4
- description = "Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native RGB effects, per-key painting, live animations, and Cfg.ini keymap restore — no vendor software required"
3
+ version = "0.4.0"
4
+ description = "Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native RGB effects, per-key painting, live animations, on-device key macros, and Cfg.ini keymap restore — no vendor software required"
5
5
  readme = "README.md"
6
6
  keywords = [
7
7
  "redragon",
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "fizzctl"
3
- version = "0.2.1"
4
- description = "Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native RGB effects, per-key painting, live animations, and Cfg.ini keymap restore — no vendor software required"
3
+ version = "0.4.0"
4
+ description = "Control a Redragon K617 Fizz keyboard on Linux: solid colors, 22 firmware-native RGB effects, per-key painting, live animations, on-device key macros, and Cfg.ini keymap restore — no vendor software required"
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
7
7
  authors = [{ name = "Ayoub Dya", email = "ayoubdya@gmail.com" }]
@@ -7,4 +7,4 @@ by :func:`main_dev` via the ``fizzctl-dev`` console script.
7
7
  from .cli import main, main_dev
8
8
 
9
9
  __all__ = ["main", "main_dev"]
10
- __version__ = "0.2.0"
10
+ __version__ = "0.4.0"
@@ -6,6 +6,10 @@ All constants come from USB captures of the OEM software:
6
6
  * FW_TEMPLATE — the 5-frame effect template: shared MODE and ROUTING,
7
7
  a distinct CANVAS, and five byte overrides of CONST_EXEC.
8
8
  * RGB_EXEC / RGB_SEC — the whole-board solid-color variant.
9
+ * CONST_KEYMAP — a clean 1032-byte 06 04 d4 keymap block (no macro
10
+ bindings), captured from the device. Used as the fallback base when the
11
+ device's keymap cannot be read; KeymapEncoder can rebuild the same block
12
+ from a Cfg.ini.
9
13
  """
10
14
 
11
15
 
@@ -209,6 +213,42 @@ FW_TEMPLATE = [
209
213
  _patch(CONST_EXEC, EXEC_DIFFS),
210
214
  ]
211
215
 
216
+ CONST_KEYMAP = bytes.fromhex(
217
+ "0604d4004000000000000000020000000200000d02000014060000e1060000e0"
218
+ "00000000020000010200000e020000150000001d0200001e0000000002000002"
219
+ "0200000f020000160000001b0200001f00000000020000030200001002000017"
220
+ "0000000600000000000000000200000400000015000000090000001900000000"
221
+ "0000000002000005000000170000000a00000005020000200000000002000006"
222
+ "0000001c0000000b00000011000000000000000002000007000000180000000d"
223
+ "0200001a0000000000000000020000080000000c0000000e0200001b20000000"
224
+ "0000000002000009000000120000000f0200001c00000050000000000200000a"
225
+ "02000011020000180200001d00000000000000000200000b0200001202000019"
226
+ "0000000000000000000000000200000c02000013000000000000000000000051"
227
+ "000000000000002a0000003100000028000000520000004f0000000000000000"
228
+ "0000000000000000000000000000000000000000000000000000000000000000"
229
+ "0000000000000000000000000000000000000000000000000000000000000000"
230
+ "0000000000000000000000000000000000000000000000000000000000000000"
231
+ "0000000000000000000000000000000000000000000000000000000000000000"
232
+ "0000000000000000000000000000000000000000000000000000000000000000"
233
+ "000000000000000000000000000000000000000000000000000000290000001e"
234
+ "0000001f00000020000000210000002200000023000000240000002500000026"
235
+ "000000270000002d0000002e0000002b000000140000001a0000000800000013"
236
+ "0000002f00000030000000390000000400000016000000070000003300000034"
237
+ "00000010000000360000003700000038060000e3060000e20000002c00000000"
238
+ "0000000000000000000000000000000000000000000000000000000000000000"
239
+ "000000000000000000000000000000000000000000000000000000350000003a"
240
+ "0000003b0000003c0000003d0000003e0000003f000000400000004100000042"
241
+ "000000430000004400000045040000cd040000ea00000052040000e900000046"
242
+ "000000490000004c040000e200000050000000510000004f0000004a0000004d"
243
+ "0c0003000d0003000000004b0000004e0e0000010b0003000e00000700000000"
244
+ "0000000000000000000000000000000000000000000000000000000000000000"
245
+ "0000000000000000000000000000000000000000000000000000000000000000"
246
+ "0000000000000000000000000000000000000000000000000000000000000000"
247
+ "0000000000000000000000000000000000000000000000000000000000000000"
248
+ "0000000000000000000000000000000000000000000000000000000000000000"
249
+ "0000000000000000"
250
+ )
251
+
212
252
  RGB_SEC = bytes.fromhex(
213
253
  "ffffffffff000000000000000000000000000000ffffffffff00000000000000"
214
254
  "00000000000000000000ffffff00ff000000000000000000000000000000ff00"