Skip to content

feat(Windows): Add virtualhid_control diagnostic UI tool#44

Merged
ReenigneArcher merged 12 commits into
masterfrom
feat/ui
Jul 6, 2026
Merged

feat(Windows): Add virtualhid_control diagnostic UI tool#44
ReenigneArcher merged 12 commits into
masterfrom
feat/ui

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Adds a ui diagnostic tool for Windows.

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

  • 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

Introduces virtualhid_control, a native Windows UI for creating, controlling, and testing virtual gamepads. The tool provides interactive gamepad creation from built-in profiles, button and stick controls, device node inspection, and output report monitoring.

Includes CMake build configuration with support for static runtime linking on Windows (MinGW/UCRT64 and MSVC) and platform-specific flags. Documentation covers platform limitations, build options, driver packaging integration, and usage instructions. Cross-platform stub provided for non-Windows platforms.
Add Windows resources and wire the `virtualhid_control` tool to use an app icon. The UI now supports removing devices, locking buttons, battery controls, richer output summaries, and improved layout/visibility handling for supported controls. Update docs to reflect the expanded gamepad management and feedback features.
Improve window clipping, redrawing, and layout handling:
- Add WS_CLIPCHILDREN and WS_CLIPSIBLINGS window styles for proper child control rendering
- Force window redraw on size changes and profile switching
- Add SWP_NOCOPYBITS flag to prevent drawing artifacts during repositioning
- Remove tick marks from trackbars for cleaner appearance
- Extract layout dimensions into named constants for better maintainability
- Refactor battery control positioning with configurable spacing
- Increase minimum window size from 900x660 to 980x740
- Track visibility changes to optimize redraw operations
- Add relayout_and_redraw() helper to ensure consistent UI updates
Update the Windows driver build step to include `virtualhid_control` alongside the existing catalog and adapter targets, so CI covers the control target as part of the driver pipeline.
Relocate libvirtualhid.ico from tools/windows/ to the project root directory. Update CMakeLists.txt to include the project source directory in the include path so the resource build can locate the icon file.
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 22.84730% with 672 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.15%. Comparing base (bef70b8) to head (b62cf38).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tools/virtualhid_control.cpp 0.00% 670 Missing ⚠️
tools/virtualhid_control_model.cpp 99.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #44       +/-   ##
===========================================
- Coverage   89.77%   76.15%   -13.63%     
===========================================
  Files          14       18        +4     
  Lines        4500     5188      +688     
  Branches     1511     1987      +476     
===========================================
- Hits         4040     3951       -89     
- Misses        345     1105      +760     
- Partials      115      132       +17     
Flag Coverage Δ
Linux-Clang 65.94% <63.69%> (-5.15%) ⬇️
Linux-GCC 81.00% <95.02%> (-2.61%) ⬇️
Windows-MSVC 90.77% <100.00%> (+0.55%) ⬆️
Windows-MinGW-UCRT64 63.38% <20.35%> (-18.77%) ⬇️
macOS 64.38% <78.08%> (-6.57%) ⬇️

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

Files with missing lines Coverage Δ
tools/virtualhid_control_model.cpp 99.00% <99.00%> (ø)
tools/virtualhid_control.cpp 0.00% <0.00%> (ø)

... and 10 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 bef70b8...b62cf38. Read the comment docs.

Add a dedicated `run_gamepad_adapter_example` CMake target and use it in CI so the gamepad adapter runs from the correct generator-specific output path on all platforms. CI now also enables `LIBVIRTUALHID_BUILD_TOOLS`, and coverage collection was broadened to include `examples/`, `src/`, and `tools/` while excluding `tests/` and `third-party/` noise. Development docs were updated to document the new run target.
Stop shipping the reviewer PowerShell validation scripts in the Windows package, and update the Windows driver and store review docs to point reviewers at the installed `virtualhid_control.exe` UI instead. The unit test is also cleaned up to use unqualified `GamepadOutputKind` enum values for readability.
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@ReenigneArcher ReenigneArcher merged commit 4715020 into master Jul 6, 2026
27 of 29 checks passed
@ReenigneArcher ReenigneArcher deleted the feat/ui branch July 6, 2026 19:54
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.

1 participant