Skip to content

feat(input): implement libvirtualhid#5368

Draft
ReenigneArcher wants to merge 16 commits into
masterfrom
libvirtualhid
Draft

feat(input): implement libvirtualhid#5368
ReenigneArcher wants to merge 16 commits into
masterfrom
libvirtualhid

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Jul 3, 2026

Copy link
Copy Markdown
Member

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:

  • CI/CD passing
  • Sonar
  • Ensure we cover changes in the following PRs:
  • Test coverage
  • Testing
    • Windows
      • Gamepads
      • Keyboard
      • Mouse
      • Touchscreen
      • Pen
      • Trackpad (not supported on Windows)
    • Linux
      • Gamepads
      • Keyboard
      • Mouse
      • Touchscreen
      • Pen
      • Trackpad
    • FreeBSD
      • Gamepads
      • Keyboard
      • Mouse
      • Touchscreen
      • Pen
      • Trackpad
    • macOS
      • Gamepads (not supported on macOS currently)
      • Keyboard
      • Mouse
      • Touchscreen (not supported on macOS)
      • Pen (not supported on macOS)
      • Trackpad (not supported on macOS)
  • Remove vigembus helpers from web-ui
  • Create release of libvirtualhid
  • Publish libvirtualhid driver to MSFT store

Known issues:

  • Xbox Series gamepad on Windows - missing "Share/Misc" button
  • DS4/DS5/Nintendo Switch Pro gamepads - rumble does not work

Screenshot

image

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@ReenigneArcher ReenigneArcher changed the title feat: implement libvirtualhid feat(input): implement libvirtualhid Jul 3, 2026
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 1.24kB (0.05%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sunshine-esm 859.68kB 1.24kB (0.14%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/createLucideIcon-*.js 209 bytes 359.87kB 0.06%
assets/config-*.js 924 bytes 73.21kB 1.28%
assets/index-*.js 388 bytes 46.42kB 0.84%
assets/troubleshooting-*.js 135 bytes 9.21kB 1.49%
assets/download-*.js (Deleted) -414 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 31.75824% with 621 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.24%. Comparing base (9d2409f) to head (19ba419).
⚠️ Report is 10 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/virtualhid_input.cpp 31.16% 422 Missing and 2 partials ⚠️
src/confighttp.cpp 36.66% 92 Missing and 3 partials ⚠️
src/platform/windows/input.cpp 10.66% 60 Missing and 7 partials ⚠️
src/platform/linux/input/virtualhid.cpp 53.84% 14 Missing and 4 partials ⚠️
src/platform/macos/input.cpp 54.54% 10 Missing ⚠️
src/input.cpp 0.00% 5 Missing ⚠️
src/config.cpp 0.00% 1 Missing ⚠️
src/platform/virtualhid_input.h 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5368      +/-   ##
==========================================
+ Coverage   26.68%   27.24%   +0.55%     
==========================================
  Files         111      106       -5     
  Lines       25397    25064     -333     
  Branches    11231    11216      -15     
==========================================
+ Hits         6777     6828      +51     
- Misses      15597    17142    +1545     
+ Partials     3023     1094    -1929     
Flag Coverage Δ
Archlinux 0.00% <0.00%> (ø)
FreeBSD-aarch64 ?
FreeBSD-amd64 12.84% <14.43%> (-0.31%) ⬇️
Homebrew-macos-14 19.80% <15.60%> (-0.49%) ⬇️
Homebrew-macos-15 19.97% <15.60%> (-0.49%) ⬇️
Homebrew-macos-26 20.08% <15.60%> (-0.50%) ⬇️
Homebrew-ubuntu-24.04 13.43% <19.45%> (+0.53%) ⬆️
Linux-AppImage 12.78% <19.45%> (+0.54%) ⬆️
Windows-AMD64 15.71% <14.26%> (+0.53%) ⬆️
Windows-ARM64 13.68% <12.75%> (+0.46%) ⬆️
macOS-arm64 17.21% <15.45%> (-0.48%) ⬇️
macOS-x86_64 17.86% <15.45%> (-0.52%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/config.h 0.00% <ø> (ø)
src/confighttp.h 100.00% <ø> (ø)
src/platform/common.h 34.37% <100.00%> (+0.78%) ⬆️
src/config.cpp 24.26% <0.00%> (ø)
src/platform/virtualhid_input.h 0.00% <0.00%> (ø)
src/input.cpp 18.01% <0.00%> (+0.02%) ⬆️
src/platform/macos/input.cpp 59.25% <54.54%> (+9.44%) ⬆️
src/platform/linux/input/virtualhid.cpp 53.84% <53.84%> (ø)
src/platform/windows/input.cpp 5.40% <10.66%> (+4.93%) ⬆️
src/confighttp.cpp 44.59% <36.66%> (+1.58%) ⬆️
... and 1 more

... and 40 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d2409f...19ba419. Read the comment docs.

Comment thread src/confighttp.cpp Fixed
Comment thread tests/unit/test_confighttp.cpp Fixed
Comment thread tests/unit/test_confighttp.cpp Fixed
@ReenigneArcher
ReenigneArcher force-pushed the libvirtualhid branch 7 times, most recently from a3e7ed7 to fe08cf1 Compare July 15, 2026 12:30
@ReenigneArcher
ReenigneArcher force-pushed the libvirtualhid branch 6 times, most recently from e1bceb2 to 7b27b1d Compare July 17, 2026 13:36
Prefix selected virtual gamepad profile names with `Sunshine ` and switch Linux udev matching to the new `Sunshine (libvirtualhid)*` pattern. This removes per-controller rule duplication, keeps device permissions working across profiles, updates troubleshooting docs with the new PS5 device name, and bumps the libvirtualhid submodule to the matching revision.
@ReenigneArcher
ReenigneArcher force-pushed the libvirtualhid branch 9 times, most recently from bf4a745 to 6f6d4c1 Compare July 19, 2026 23:32
Broadened Back/Select-to-touchpad-click behavior from manual DS4-only to all PlayStation-style profiles (auto, DS4, and DS5) by reusing configured touchpad-capability checks in both Windows and virtualhid input paths. Updated config/docs/UI locale text to consistently describe PlayStation-style emulation, simplified the input tab headings/visibility logic, and added unit tests for touchpad support detection across profiles.
Update `docs/configuration.md` to move the FreeBSD/Linux/Windows applicability note for gamepad emulation into the main option description, and remove the repeated note text from each individual choice entry.
@ReenigneArcher
ReenigneArcher force-pushed the libvirtualhid branch 3 times, most recently from ddfb648 to c0b07b1 Compare July 21, 2026 14:31
@sonarqubecloud

sonarqubecloud Bot commented Jul 21, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
4 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Comment thread .github/workflows/ci-linux.yml Dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment