feat(input): implement libvirtualhid#5368
Conversation
Bundle ReportChanges will decrease total bundle size by 2.48kB (-0.1%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sunshine-esmAssets Changed:
|
92ddf06 to
d696dca
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #5368 +/- ##
==========================================
- Coverage 26.71% 26.10% -0.61%
==========================================
Files 111 105 -6
Lines 25329 26022 +693
Branches 11197 11901 +704
==========================================
+ Hits 6766 6793 +27
- Misses 14651 17190 +2539
+ Partials 3912 2039 -1873
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 37 files with indirect coverage changes Continue to review full report in Codecov by Harness.
|
b09b74e to
c8d6008
Compare
4a64041 to
ed17e4f
Compare
ed17e4f to
67787f0
Compare
a3e7ed7 to
fe08cf1
Compare
Replace the ViGEmBus install/status flow with a unified virtual input driver status endpoint and UI. Update Windows packaging, docs, locale strings, and troubleshooting pages to reflect libvirtualhid as the primary backend, with ViGEmBus shown only as a fallback. Add unit coverage for driver version parsing and status JSON helpers.
Replace Windows-native synthetic pointer/keyboard input implementations with libvirtualhid equivalents: - Remove keylayout.h and its VK-to-scancode mapping (now handled by libvirtualhid) - Remove Windows-specific touch/pen device management (HSYNTHETICPOINTERDEVICE, repeat tasks, slot compaction) - Pass touch_port and flags through to libvirtualhid for keyboard, touch, and pen events - Add pointer_viewport() and keyboard_event() helpers in virtualhid_input.cpp - Differentiate LI_TOUCH_EVENT_UP, CANCEL, and HOVER_LEAVE handling for touch contacts - Add PointerTransition support for pen events - Update capability detection to use libvirtualhid runtime - Update libvirtualhid submodule to c1cc7e0
Replace the macOS input implementation with a libvirtualhid-backed backend and route mouse, keyboard, scroll, touch/pen, and gamepad paths through shared virtualhid contexts. Update macOS CMake wiring to build/link libvirtualhid and include the new shared virtualhid input sources, and bump the libvirtualhid submodule to the required revision.
Move libvirtualhid integration from Linux/macOS/Windows compile definition files into common.cmake. This removes duplicated target/library/source wiring, keeps Linux-specific libevdev override variables set before inclusion, and preserves the libevdev -> libvirtualhid build dependency when using the ExternalProject fallback.
Refactor absolute mouse test to use platform-aware touch port helper and account for display origin offsets when verifying expected mouse position. Removes the incorrect `has_input_moved` assertion and updates libvirtualhid submodule.
Implement get_mouse_loc using GetCursorPos on Windows and XQueryPointer on Linux/X11. Remove the GTEST_SKIP for Windows and Linux virtual mouse tests. Replace fixed sleep with polling loop to wait for mouse movement, fix absolute mouse port to use virtual screen metrics on Windows, and relax movement assertions to direction-only checks to account for OS pointer acceleration.
Change `get_mouse_loc()` to return `std::optional<util::point_t>` instead of a sentinel value, properly indicating when the mouse location cannot be observed on a platform. Update all platform implementations (Linux, macOS, Windows) and tests to handle the optional return type. Add libxtst-dev dependency to Linux CI workflow.
Add `NOSONAR(cpp:S1313)` annotations to ViGEmBus version literals in `confighttp.cpp` and its unit test. This documents that `1.17.0.0` is a driver version, not an IP address, and prevents false-positive static analysis warnings.
fe08cf1 to
2b25b79
Compare
2b25b79 to
7a07582
Compare
|


Description
This PR implements libvirtualhid in Sunshine, replacing inputtino on Linux, vigembus on Windows AMD64, and moves the mouse/keyboard input for macOS as well.
We will still falling back to vigembus on Windows ARM64 or in cases where the user doesn't have libvirtualhid's driver installed.
TODO:
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage