Skip to content

Superstrike Buttons tab: button assignments, HITS presets and speed test, Bunny Hop card, battery hours, setup code - #684

Merged
snekxs merged 61 commits into
OpenMouse-Project:mainfrom
onyxhq-dev:feat/button-map
Oct 8, 2026
Merged

snekxs merged 61 commits into
OpenMouse-Project:mainfrom
onyxhq-dev:feat/button-map

Conversation

@onyxhq-dev

Copy link
Copy Markdown
Contributor

Summary

A reworked Buttons tab for the PRO X 2 and PRO X 3 Superstrike: button assignments as a picture like G HUB's "Zuweisungen", a HITS Tuning card with presets and a speed test, Bunny Hop as its own card, battery hours, and one setup code that shares it all.

New features

Button assignments (new card, PRO X 2 / PRO X 3 Superstrike)

  • The mouse as a picture with a callout per button (Primary, Secondary, Middle, Forward, Back). Pick a button, then a command.
  • A searchable command list: mouse actions, DPI, profile switching, editing, browser, media and system shortcuts.
  • Record any key or shortcut for a button.
  • Reset button and Reset all.
  • Standard and G-Shift layers. The two main clicks are locked so the mouse cannot be left unusable.
  • A warning when two buttons do the same thing.
  • Status in the header: connection, battery percent and the hours left.
  • On the Host profile the card stays and explains that assignments live in the onboard profiles, with a button to open one.
  • The card follows the window height, stacks on narrow widths, keeps the list inside the card, and stays visible while a flash runs.
  • All changes go through the existing staged write, so Instant flash and the Flash bar behave as elsewhere.

Share setup

  • One short code (SETUP1-..., checksummed) for HITS tuning, Bunny Hop, the Middle, Back and Forward assignments and the DPI stages. Copy yours, or paste one and see what it contains before applying.
  • Parts the mouse cannot take are skipped and listed. The two main clicks are never written.

HITS Tuning

  • Its own card, with Bunny Hop split out into a separate card below it.
  • Presets: built-in Default, Competitive, Balanced and Casual, the pro player profiles from G HUB (Whzy, ShowMaker, MrFaliN, Gryffinn, m0NESY), and your own saved presets, kept in the browser.
  • The preset dropdown follows the values on the mouse, so it still shows the right preset after a refresh.
  • Save, Delete and Reset (to Default), with modals instead of browser prompts.
  • Copy left to right, right to left, and swap, in Independent mode.
  • Speed test, like G HUB's: click when the field turns blue, and see the time saved against a conventional switch (step 5) with the time at each step. The actuation can be changed inside the test.
  • With Instant flash on, a HITS change flashes at once and the Apply buttons are hidden.

Bunny Hop

  • A separate "Bunny hop" card.
  • "Check for bounce": click a button quickly, count presses closer than 30 ms, and get a suggested Bunny Hop time with a button to apply it.

Battery

  • Battery time left in the device status pill and the Overview pill, with a fallback to the mouse's rated life when there is no history yet.
  • On the PRO X 3 the rated 135 h at 1000 Hz is scaled by the polling rate using Logitech's per-rate power figures.
  • Polling rate buttons show the hours a full charge lasts at each rate (PRO X 3).

Build

  • The CSS budget is raised to 225 kB and the JS budget to 2.2 MB, for the new Buttons tab and protocol 0.28.0. Measured: CSS 210.6 kB (was over the 210 kB budget), JS 2,150.4 kB (was 350 bytes over 2.15 MB).

Testing

  • npx tsc --noEmit is clean. The test count rises to 328 (new tests for presets, setup codes, the speed test maths, the button layout, commands and conflict hints, and the battery rates).
  • CI is green on the branch.
  • Checked on a PRO X 3 Superstrike over its receiver: writing button assignments and shortcuts, Reset all, the presets, the speed test, Share setup, the polling rate hours, and the layout when the window is resized.
  • Not tested on hardware: the PRO X 2 (it uses the same code, with button positions measured from its artwork only), the bounce check, and the Host profile notice.

Notes

A HITS step button only updated on-screen state; the change was staged, and so
flashed by instant flash, only when Apply was pressed. With instant flash on,
stage the change as soon as a step is picked: both-buttons changes through the
shared writer (one profile write), left and right through their own button.
Without instant flash it still waits for Apply.
With instant flash on a HITS step is staged and flashed as soon as it is picked,
so the Apply to both buttons and per-button Apply buttons have nothing left to
do. Hide them then. They stay while a game-profile draft is open, because HITS
changes are not flashed there.
The HITS Tuning card was a separate section below the card list, so on a
Superstrike the Buttons tab showed the Switches card first and the HITS card
under it. Make it the first card in the list, which also keeps the mouse panel
beside it, and put Bunny Hop at the bottom of the card. Bunny Hop is a
per-profile setting and the Superstrike has no LightForce switches, so it no
longer needs the Switches card.
Inside the card list the HITS card lost its border and background, because the
list is one merged panel whose cards are flattened into dividers, so it no
longer looked like the card it was. Render it first in the right-hand column
as its own card, above the merged panel, with the mouse panel still beside it.
…allback

The battery time estimate was computed but nothing has rendered it since the
2026-09-08 UI rewrite (batteryDetail has no caller). Show it in the status pill
after the battery percent, on the tabs that carry the device panel, with the
full wording on hover.

The history-based estimate still needs 10 minutes and a 1% change, so until
then a mouse with a known rated life (PRO X 2 Superstrike 90 h, PRO X 3
Superstrike 135 h) shows how long the charge would last at that rate, labelled
as rated. Discharging only; a charging time is not guessed. Adds the label in
all 11 locales and tests for the rated figures.
The rated 135 h is for one polling rate, but the mouse draws far more at 8000 Hz
than at 1000 Hz. Use the system and signal draw per rate, as G HUB shows them
for the PRO X 3 (e.g. 4 + 4 mW at 1000 Hz, 12 + 20 mW at 8000 Hz), to scale the
rated figure to the rate in use. The 135 h quote is taken to be at 1000 Hz.

These figures are not read from the mouse: a capture of G HUB stepping through
every rate shows only the set-rate command and no power values, so G HUB has them
built in. Models without a table keep the plain rated hours.
…sumption

Comment only. The capacity (1080 mWh) follows from that quote and the 8 mW draw
at 1000 Hz.
The Overview tab has its own status pill (connection, DPI, battery, rate,
profile) separate from the device panel's. Add the time left after the battery
percent there as well, with the full wording on hover.
A presets row in the HITS card: pick a saved setup to load it, Save the current
values under a name, Delete one, Copy a short code for the current setup, or
Import a code. A preset holds both buttons' actuation, rapid trigger level and
on/off, and click haptics. Equal buttons load on the Both tab, unequal ones on
Independent. With instant flash on a loaded preset is written at once, both
buttons in one profile write; otherwise it waits for Apply.

The code is HITS1- plus a base64url of the values and a checksum, so a mistyped
or foreign code is rejected; the name is not in it. Values are checked against
the mouse's own limits before loading. Presets live in this browser only, since
the mouse has nowhere to store names. Not compatible with G HUB's HITS-Code,
whose format is unknown. Labels are English, like the card's heading.
Import code opens a dialog with a paste box, live validation, a preview of what
the code holds, and an optional name to save it under; Import stays disabled until
the code is valid and fits the mouse. Delete opens a confirm dialog naming the
preset. Both reuse the existing dialog markup and styles, with a destructive
colour from the theme token for the confirm button.
…PRO X 3 Superstrike)

A card on the Buttons tab, under the HITS card: the mouse artwork with a callout
per button (primary, secondary, middle, forward, back), a searchable command list
(mouse actions, DPI, profiles, editing and browser shortcuts, media keys, system),
and a Standard / G-Shift toggle. Pick a button, then a command. The write is the
existing staged applyLogitechButtonAssignment, so instant flash, the Flash bar
and the Profiles tab all agree. Primary and secondary click stay locked on the
Standard layer, as in the Profiles tab.

- logitech-commands: the catalog, mapped onto the three record kinds the profile
  stores, with a round-trip test through the protocol's own encoder.
- logitech-button-map: button positions on the X2 and X3 artwork.
- The card stacks under the mouse when it is narrow (container query).
- Overrides the HITS card's legacy order inside the new container so it stays first.

Keyboard shortcuts are from a fixed list; recording a custom one stays in the
Profiles tab. Not tried on a real mouse: button writes on format 8 have not been
hardware-tested.
The Buttons tab showed the side panel's mouse picture and the button map's own.
When the map is shown, drop the side panel so there is one mouse and the cards
use the full width (the HITS card gets its original wide look back). The device
name, connection and battery move into the map card's header. The map is larger
(27rem), with wider callouts and a wider command list.
Smaller mouse (20rem), a shorter command list and tighter spacing. The locked tag
moves to the label's second line so Primary and Forward no longer touch. The
command list gets a slim rounded scrollbar like the app's other lists, without
the arrow buttons; Firefox keeps the standard thin scrollbar properties.
Two columns from 1200px up; narrower windows keep them stacked.
…G HUB locks onboard macros"

This reverts commit a02dae3.
… G HUB locks onboard macros"

This reverts commit f968a17.
@onyxhq-dev
onyxhq-dev marked this pull request as ready for review October 8, 2026 13:52
@snekxs
snekxs merged commit e318583 into OpenMouse-Project:main Oct 8, 2026
3 checks 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.

2 participants