Skip to content

feat(input): update libvirtualhid integration - #5563

Merged
ReenigneArcher merged 5 commits into
masterfrom
feat/libvirtualhid-updates
Aug 30, 2026
Merged

feat(input): update libvirtualhid integration#5563
ReenigneArcher merged 5 commits into
masterfrom
feat/libvirtualhid-updates

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

  • add driver-backed HID keyboard lifecycle and license refresh handling
  • advertise Switch Pro motion support and forward player LED feedback (LED will not work in Moonlight without updates on the client side)
  • Xbox pads prefer UHID on Linux (enabling impulse triggers)
  • bump libvirtualhid and the minimum supported Windows driver version

TODO:

  • update min Virtual HID Driver version after next release

Screenshot

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

See our AI usage policy.

  • 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

Renamed the license-state refresh flow from mouse-only to shared virtual input so Sunshine now recreates both libvirtualhid keyboard and mouse devices, including resetting keyboard/mouse state before refresh. Added explicit keyboard refresh support in the virtualhid input context and wired config HTTP license updates to trigger the full refresh.

Updated Windows-facing messaging and docs to describe Raw Input keyboard + mouse support, added troubleshooting guidance for keyboard detection, and adjusted tray/UI localization strings accordingly. Also bumped the minimum supported Virtual HID Driver version to 2026.826.2024.22, updated related unit tests, and advanced the libvirtualhid submodule.
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 91 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sunshine-esm 880.42kB 91 bytes (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/logo-*.js 91 bytes 385.36kB 0.02%

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.33333% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.91%. Comparing base (377e07c) to head (754e06c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/stream.cpp 16.66% 10 Missing ⚠️
src/confighttp.cpp 0.00% 1 Missing ⚠️
src/platform/linux/input/virtualhid.cpp 0.00% 0 Missing and 1 partial ⚠️
src/platform/virtualhid_input.cpp 97.77% 1 Missing ⚠️
src/platform/windows/input.cpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5563      +/-   ##
==========================================
+ Coverage   33.65%   33.91%   +0.25%     
==========================================
  Files         104      104              
  Lines       25125    25193      +68     
  Branches    11118    11145      +27     
==========================================
+ Hits         8457     8543      +86     
- Misses      13824    15635    +1811     
+ Partials     2844     1015    -1829     
Flag Coverage Δ
Archlinux 0.00% <0.00%> (ø)
FreeBSD-amd64 19.68% <64.70%> (+0.22%) ⬆️
Homebrew-macos-14 31.01% <72.58%> (+0.24%) ⬆️
Homebrew-macos-15 31.71% <72.58%> (+0.24%) ⬆️
Homebrew-macos-26 31.83% <72.58%> (+0.24%) ⬆️
Homebrew-ubuntu-24.04 20.92% <64.91%> (+0.15%) ⬆️
Linux-AppImage 20.34% <64.91%> (?)
Windows-AMD64 25.94% <64.70%> (+0.16%) ⬆️
Windows-ARM64 21.88% <58.73%> (+0.21%) ⬆️
macOS-arm64 25.90% <64.70%> (+0.32%) ⬆️
macOS-x86_64 26.55% <64.70%> (?)

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

Files with missing lines Coverage Δ
src/input.cpp 31.18% <100.00%> (+0.50%) ⬆️
src/input.h 50.00% <ø> (ø)
src/platform/common.h 60.44% <100.00%> (+1.85%) ⬆️
src/platform/macos/input.cpp 85.71% <100.00%> (ø)
src/platform/virtualhid_input.h 0.00% <ø> (ø)
src/system_tray.cpp 80.51% <100.00%> (+0.23%) ⬆️
src/confighttp.cpp 54.33% <0.00%> (ø)
src/platform/linux/input/virtualhid.cpp 75.60% <0.00%> (ø)
src/platform/virtualhid_input.cpp 97.74% <97.77%> (+0.24%) ⬆️
src/platform/windows/input.cpp 16.66% <0.00%> (ø)
... and 1 more

... and 41 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 377e07c...754e06c. Read the comment docs.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Last Updated 2026-08-30 01:06:47 UTC
Source Run CI Run #5175
Commit 754e06cf7e72f07cbc77e62bd9f274ac9f4e491d

Screenshot Comparison

PR #5563 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

@ReenigneArcher
ReenigneArcher force-pushed the feat/libvirtualhid-updates branch from 596fbf9 to 91434da Compare August 28, 2026 01:16
Introduce a new gamepad feedback path for player indicator LEDs, including a new feedback message type, control-stream packet encoding (0x5504), and virtual HID output handling with deduplication of repeated LED states. Broaden controller extension capability detection from touchpad-only to touchpad-or-motion and use it consistently across Linux, macOS, and Windows capability reporting. Update unit tests to cover both touchpad support and controller extension advertising, plus player LED routing/dedup behavior, and bump the libvirtualhid submodule.
@ReenigneArcher
ReenigneArcher force-pushed the feat/libvirtualhid-updates branch from 91434da to 923eb82 Compare August 28, 2026 15:51
@ReenigneArcher ReenigneArcher changed the title feat: libvirtualhid updates feat(input): update libvirtualhid integration Aug 28, 2026
@ReenigneArcher
ReenigneArcher marked this pull request as ready for review August 28, 2026 16:50
@ReenigneArcher
ReenigneArcher marked this pull request as draft August 28, 2026 19:39
@ReenigneArcher
ReenigneArcher force-pushed the feat/libvirtualhid-updates branch 12 times, most recently from 13e5b36 to 735842d Compare August 29, 2026 15:10
@ReenigneArcher
ReenigneArcher force-pushed the feat/libvirtualhid-updates branch from 735842d to 2ab80c8 Compare August 29, 2026 17:25
Extend udev rule reloading to cover hidraw and input subsystems so permissions are applied to dynamically created libvirtualhid gamepad child nodes, not just /dev/uinput and /dev/uhid.

Also:
- Always install the udev rules file regardless of whether libudev is detected at build time
- Add Homebrew postinst support to copy rules to host-monitored directories
- Trigger udevadm reload on rule removal (AppImage, Flatpak)
- Update comments to say "gamepad emulation" instead of "DS5 emulation"
- Add docs clarifying that manual chmod/setfacl changes are lost on reconnect and how to reload rules
@ReenigneArcher
ReenigneArcher force-pushed the feat/libvirtualhid-updates branch from 67945fd to 50c5419 Compare August 29, 2026 21:46
Raise the minimum supported Virtual HID Driver version to `2026.829.2338.54` in config HTTP status output, update the related unit test expectations, and sync the Getting Started and Troubleshooting docs. The embedded `libvirtualhid` submodule is also updated to match the newer Windows control and broker protocol requirements.
@ReenigneArcher
ReenigneArcher marked this pull request as ready for review August 30, 2026 00:25
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit c75d5d7 into master Aug 30, 2026
62 of 63 checks passed
@ReenigneArcher
ReenigneArcher deleted the feat/libvirtualhid-updates branch August 30, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gyro Support for Switch Pro Controller emulation

1 participant