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 863.7kB 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/logo-*.js 209 bytes 380.99kB 0.05%
assets/config-*.js 924 bytes 73.1kB 1.28%
assets/index-*.js 388 bytes 47.2kB 0.83%
assets/troubleshooting-*.js 135 bytes 9.18kB 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.
⚠️ Please upload report for BASE (master@25c06d7). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/virtualhid_input.cpp 30.42% 372 Missing and 51 partials ⚠️
src/confighttp.cpp 37.41% 58 Missing and 34 partials ⚠️
src/platform/windows/input.cpp 10.66% 57 Missing and 10 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

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5368   +/-   ##
=========================================
  Coverage          ?   28.68%           
=========================================
  Files             ?      104           
  Lines             ?    24372           
  Branches          ?    10890           
=========================================
  Hits              ?     6990           
  Misses            ?    14204           
  Partials          ?     3178           
Flag Coverage Δ
Archlinux 0.00% <0.00%> (?)
FreeBSD-amd64 13.67% <14.61%> (?)
Homebrew-macos-14 21.97% <15.78%> (?)
Homebrew-macos-15 22.62% <15.78%> (?)
Homebrew-macos-26 22.74% <15.78%> (?)
Homebrew-ubuntu-24.04 14.56% <19.83%> (?)
Linux-AppImage 13.98% <19.83%> (?)
Windows-AMD64 17.93% <14.45%> (?)
Windows-ARM64 15.41% <12.94%> (?)
macOS-arm64 19.25% <15.64%> (?)
macOS-x86_64 19.94% <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%> (ø)
src/config.cpp 24.26% <0.00%> (ø)
src/platform/virtualhid_input.h 0.00% <0.00%> (ø)
src/input.cpp 18.02% <0.00%> (ø)
src/platform/macos/input.cpp 59.25% <54.54%> (ø)
src/platform/linux/input/virtualhid.cpp 53.84% <53.84%> (ø)
src/platform/windows/input.cpp 5.43% <10.66%> (ø)
src/confighttp.cpp 44.73% <37.41%> (ø)
... and 1 more

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

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Last Updated 2026-08-08 21:22:21 UTC
Source Run CI Run #4907
Commit 9dc8a042b7ac17ecb169978610411f92d6a6fff5

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

@sonarqubecloud

sonarqubecloud Bot commented Aug 8, 2026

Copy link
Copy Markdown

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