Skip to content

Implement battery readout and button remapping#1

Merged
SpookyyQ merged 2 commits into
mainfrom
feature/button-remapping-battery
Jun 29, 2026
Merged

Implement battery readout and button remapping#1
SpookyyQ merged 2 commits into
mainfrom
feature/button-remapping-battery

Conversation

@SpookyyQ

@SpookyyQ SpookyyQ commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Reverse-engineered (from WebHID captures) and implemented two previously-missing features for the IPI FLY PRO.

Battery

  • The 0x04 reply carries the cell voltage in mV (bytes 7..=8, big-endian), not a percent byte.
  • Mapped to a charge percentage via a Li-Ion discharge curve anchored on real captures (3813 mV = 42 %, 4013 mV = 77 %).

Button remapping

  • Decoded the 0x07 slot-write frame: slot address, action category, HID button code, and the action/tail/global checksums.
  • Confirmed all five physical button slots and their default actions:
    • 0x60 Left, 0x64 Right, 0x68 Middle, 0x6c Back, 0x70 Forward
  • Added cmd_button, cmd_set_button (per-button remap) and cmd_reset_buttons (restore factory defaults).
  • The buttons tab now applies real changes: each button has an action dropdown, and Restore Default works.

Still in progress: non-mouse actions (DPI shortcuts, keyboard keys, macros) use other categories and are not exposed yet.

Tests / build

  • cargo test: 68 passed (every button/battery frame reproduces a real capture byte-for-byte).
  • tsc --noEmit clean, vite build succeeds.
  • Version bumped to 1.3.0.

SpookyyQ and others added 2 commits June 25, 2026 14:50
Replace the plain placeholder text on the Buttons tab with an amber
warning box and triangle icon so it is clear remapping is not yet
available.
Battery: parse the 0x04 reply as cell voltage (mV, bytes 7..=8) and map
it to a percentage via a Li-Ion discharge curve anchored on captured
points (3813 mV = 42%, 4013 mV = 77%), replacing the old guess.

Buttons: decode the 0x07 slot-write frame format (slot, action category,
HID button code, action + tail + global checksums). Add cmd_button plus
confirmed slot/action constants for all five physical buttons, a
cmd_set_button command for per-button remapping, and cmd_reset_buttons
to restore factory defaults.

UI: the buttons tab now applies real changes — each button has an action
dropdown and Restore Default works. Bump version to 1.3.0.

Co-Authored-By: WOZCODE <contact@withwoz.com>
@SpookyyQ SpookyyQ merged commit 8b1bdfe into main Jun 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant