Repository navigation
feat: custom games, game profile buttons and custom game images - #32
Draft
onyxhq-dev wants to merge 1 commit into
Draft
onyxhq-dev wants to merge 1 commit into
onyxhq-dev wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
onyxhq-dev
force-pushed
the
feat/custom-game-icons
branch
2 times, most recently
from
October 23, 2026 02:55
d2f130d to
3ea9f42
Compare
onyxhq-dev
force-pushed
the
feat/custom-game-icons
branch
from
October 23, 2026 03:08
3ea9f42 to
b277868
Compare
onyxhq-dev
force-pushed
the
feat/custom-game-icons
branch
from
October 23, 2026 03:55
b277868 to
172c245
Compare
| const client = new module[candidate.exportName](device); | ||
| try { | ||
| await withTimeout(client.open(), STEP_TIMEOUT_MS, `${candidate.exportName}.open()`); | ||
| const status = await withTimeout(client.readStatus(), STEP_TIMEOUT_MS, `${candidate.exportName}.readStatus()`); |
There was a problem hiding this comment.
🟡 Medium src/button-listener.mjs:46
Valid Logitech mice that answer only on HID++ index 0x01 are rejected as “no mouse answered”: this 3-second timeout closes the device before readStatus() can finish its fallback from 0xFF, even though each probe allows 6 seconds. Let discovery complete within the driver's full budget, or use a suitably bounded listener-specific probe.
🤖 Copy this AI Prompt to have your agent fix this:
In file @native-hid/src/button-listener.mjs around line 46:
Valid Logitech mice that answer only on HID++ index `0x01` are rejected as “no mouse answered”: this 3-second timeout closes the device before `readStatus()` can finish its fallback from `0xFF`, even though each probe allows 6 seconds. Let discovery complete within the driver's full budget, or use a suitably bounded listener-specific probe.
onyxhq-dev
force-pushed
the
feat/custom-game-icons
branch
from
October 23, 2026 04:03
172c245 to
17eaa5a
Compare
- Custom games are stored in the Bridge config, apart from the catalog, and tracked like any listed game. Names and executables are normalized and capped. - A game's profile can assign a Logitech mouse's side buttons (including media keys). A listener helper reports button changes and Bridge presses the keys while that profile is active. The default profile carries Host buttons too. - The key presses work on Windows (SendInput), Linux (a virtual keyboard and mouse through /dev/uinput, which works on X11 and Wayland) and macOS (CoreGraphics events; macOS asks for the Accessibility permission, and media keys are not pressed there yet). install-linux.sh adds the uinput udev rule and loads the module at boot. - Custom games can have a picture: uploaded (PNG, JPEG, WebP, up to 512 KB) or downloaded from a pasted link. Link downloads accept public http and https addresses only, check every redirect, connect to the checked addresses, cap size and time, and allow two at a time. - Image routes send nosniff; image reads and writes are async; the new routes have tests.
onyxhq-dev
force-pushed
the
feat/custom-game-icons
branch
from
October 23, 2026 04:23
17eaa5a to
26c256e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Bridge side of custom games and Logitech game profile buttons in the OpenMouse app.
native-hid/src/button-listener.mjsreports button changes and Bridge presses the assigned key. An unassigned side button keeps its normal click. The default profile can carry Host buttons too.SendInput. Linux uses a virtual keyboard and mouse through/dev/uinput, which works on X11 and Wayland. macOS posts CoreGraphics events and asks for the Accessibility permission. Media keys are not pressed on macOS yet.install-linux.shadds a udev rule for/dev/uinputand loads theuinputmodule at boot; the uninstall removes both.X-Content-Type-Options: nosniff.Tests:
cargo testpasses, including new tests for the config limits, the image routes, the address checks and the key tables. The new Linux and macOS modules compile forx86_64-unknown-linux-gnuandaarch64-apple-darwin.Checked by hand: the Windows listener works (bunny hop and the default Back and Forward mapping included). The Linux key injection was run on a real Linux 6.8 kernel and delivered the expected key and button events. Not tested: a Linux desktop (X11 or Wayland) and macOS, so those need someone to try them.
Draft because the listener needs a protocol release with the button listener (OpenMouse-Project/mouse-protocol#246). Once that is released,
native-hid/package.jsonshould be bumped to it. Until then the listener reports that it is unavailable and does nothing.Note
Add custom games, profile-driven side buttons, and custom game images
custom_gamesconfig collection with shared normalization and size limits;tracked_gamesmerges custom games with catalog games, and catalog names win collisions in config.rs/v1/custom-games, GET/PUT/v1/custom-games/image, GET/v1/custom-games/image-from-url, and GET/v1/default-profilein api.rsbuttons.Assignments::from_profileparses hostButtons, a Node.js helper (button-listener.mjs) reports button masks, and platform injectors emit key, media, and side-button events on Windows (SendInput), Linux (uinput), and macOS (CoreGraphics) in buttons.rsBridgeService.gamesandsnapshotnow return tracked games (catalog plus custom) instead of catalog only; the monitor suppresses button updates while a HID client session is active; unsupported operating systems log but do not inject button events; Linux installs now add a udev rule and module-load config for/dev/uinputin install-linux.sh📊 Macroscope summarized 3ea9f42. 16 files reviewed, 8 issues evaluated, 1 issue filtered, 7 comments posted
🗂️ Filtered Issues
src/buttons.rs — 3 comments posted, 4 evaluated, 1 filtered
keys(..., false)sends Ctrl-up even though Forward remains down. Assigning both buttons the same key similarly releases it on the first button-up.stepsand the injectors track button transitions but never ownership/counts of shared keys/modifiers. Microsoft's SendInput documentation states these are inserted into the keyboard input stream and current keyboard state is not reset; there is no per-action ownership supplied by that API. Track held output keys and only release on the last owner. [ Cross-file consolidated ]