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
- 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.
|
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 |
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.shMacroscope summarized 4279c34.