feat(gamepad): expose mice as opt-in virtual controllers - #1359
Open
humbertogontijo wants to merge 2 commits into
Open
humbertogontijo wants to merge 2 commits into
humbertogontijo wants to merge 2 commits into
Conversation
|
Add a minimal auxiliary gamepad path: TOML opt-in, a VirtualGamepad trait with macOS/Linux/Windows backends, and agent divert so mapped extras feed an OS-visible standard HID pad while the pointer stays native. Co-authored-by: Cursor <cursoragent@cursor.com>
Gate diversion on a live pad, pulse thumb-wheel axes back to neutral, neutralize on session cancel, recreate pads when the product name changes, and stop advertising unimplemented Linux FF_RUMBLE. Co-authored-by: Cursor <cursoragent@cursor.com>
humbertogontijo
force-pushed
the
feat/virtual-gamepad-hid
branch
from
September 17, 2026 16:28
511bbd6 to
1b0730a
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.
Summary
Browsers and many games only talk to the world through the Gamepad API / XInput-style controllers. A Logitech mouse already has remappable extras (Back/Forward, gesture button, haptic panel, thumb wheel) and often a haptic actuator (
0x19b0), but none of that shows up as a standard gamepad — so a web page or game cannot:gamepad.vibrationActuator, SDL rumble, etc.)This PR adds an opt-in auxiliary virtual HID gamepad per mouse: the pointer and primary clicks stay native; mapped extras publish as a standard-layout pad that Gamepad API clients can see. When
rumble = trueand the device has haptics, host rumble is forwarded to HID++ waveforms so pages/games that vibrate a controller can drive the mouse panel instead of a silent no-op.[devices.*.gamepad](schema v8); pointer + L/R stay native.openlogi-gamepadcrate with aVirtualGamepadtrait: macOSIOHIDUserDevice, Linuxuinput, Windows ViGEm stub (soft-fail until wired).0x19b0when capable (macOS rumble callback deferred — SDK link gap).Changes
openlogi-core:GamepadConfig/GamepadMap, schema 8, config exampleopenlogi-gamepad: new workspace crateopenlogi-agent-core/openlogi-agent: capture-plan divert, pad sync, dispatch short-circuit, rumble pollerdocs/gamepad.mdcrates/openlogi-agent/bundle/OpenLogiAgent.entitlements—com.apple.developer.hid.virtual.deviceis present but commented out so unsigned/dev builds are not killed by AMFINote for @AprilNEA — Virtual HID entitlement
macOS
IOHIDUserDeviceCreateneeds the restricted Apple entitlementcom.apple.developer.hid.virtual.deviceon the agent helper (not the GUI). The stub is ready inOpenLogiAgent.entitlements; please leave it commented until your Apple signing identity / provisioning profile is approved for Virtual HID, then wire it into agent codesign the same wayOpenLogi.entitlementsis for the GUI. Without it, pad create fails open (controls keep native/productivity behaviour).Testing
Not runtime-tested on hardware (macOS Virtual HID entitlement required for
IOHIDUserDeviceCreate). To try: enablegamepad.enabledin TOML, reload, press a mapped button, check a Chrome Gamepad tester (and a page that callsvibrationActuator.playEffectif rumble is on).