Skip to content

feat(input): implement libvirtualhid - #5368

Draft
ReenigneArcher wants to merge 1 commit into
masterfrom
libvirtualhid
Draft

feat(input): implement libvirtualhid#5368
ReenigneArcher wants to merge 1 commit 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 861.01kB 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 361.12kB 0.06%
assets/config-*.js 924 bytes 73.13kB 1.28%
assets/index-*.js 388 bytes 46.16kB 0.85%
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.36819% with 617 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.58%. Comparing base (0784774) to head (e6adb1b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/virtualhid_input.cpp 30.42% 415 Missing and 8 partials ⚠️
src/confighttp.cpp 37.41% 89 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% 4 Missing and 1 partial ⚠️
src/config.cpp 0.00% 0 Missing and 1 partial ⚠️
src/platform/virtualhid_input.h 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5368      +/-   ##
==========================================
+ Coverage   26.71%   28.58%   +1.86%     
==========================================
  Files         109      104       -5     
  Lines       24552    24345     -207     
  Branches    10764    10867     +103     
==========================================
+ Hits         6560     6958     +398     
- Misses      14067    15874    +1807     
+ Partials     3925     1513    -2412     
Flag Coverage Δ
Archlinux 0.00% <0.00%> (ø)
FreeBSD-amd64 13.65% <14.61%> (-0.32%) ⬇️
Homebrew-macos-14 21.88% <15.78%> (-0.58%) ⬇️
Homebrew-macos-15 22.52% <15.78%> (-0.60%) ⬇️
Homebrew-macos-26 22.62% <15.78%> (-0.63%) ⬇️
Homebrew-ubuntu-24.04 14.14% <19.83%> (+0.55%) ⬆️
Linux-AppImage 13.87% <19.83%> (+0.55%) ⬆️
Windows-AMD64 17.80% <14.45%> (+0.51%) ⬆️
Windows-ARM64 15.37% <12.94%> (+0.43%) ⬆️
macOS-arm64 19.26% <15.64%> (?)
macOS-x86_64 19.93% <15.64%> (?)

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%> (+1.30%) ⬆️
src/config.cpp 24.26% <0.00%> (ø)
src/platform/virtualhid_input.h 0.00% <0.00%> (ø)
src/input.cpp 18.02% <0.00%> (+0.02%) ⬆️
src/platform/macos/input.cpp 59.25% <54.54%> (+25.10%) ⬆️
src/platform/linux/input/virtualhid.cpp 53.84% <53.84%> (ø)
src/platform/windows/input.cpp 5.43% <10.66%> (+4.95%) ⬆️
src/confighttp.cpp 44.73% <37.41%> (+1.71%) ⬆️
... and 1 more

... and 61 files with indirect coverage changes

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 23 times, most recently from c0b07b1 to 19ba419 Compare July 21, 2026 17:17
Comment thread .github/workflows/ci-linux.yml Fixed
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Last Updated 2026-07-30 02:38:19 UTC
Source Run CI Run #4859
Commit e6adb1bf8927f493b52588ce6d34282f8994a668

Screenshot Comparison

PR #5368 screenshots vs screenshots baseline.

Matrix: AppImage

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment