-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add demux subcommand and operation config for system tray #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Store formatted tag string in a variable to extend its lifetime, fixing E0716. - Prefix unused variable with underscore to silence warning.
- Added `operation_mode` field to `TrayConfig` to track current mode (Mux or Demux). - Refactored `TrayState` to include separate states for Mux and Demux operations. - Updated methods to validate and retrieve primary and assist controller names based on the current operation mode. - Enhanced documentation for clarity on controller selection and configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds demultiplexing (demux) functionality to CtrlAssist, enabling one controller to control multiple virtual gamepads. The tray application has been refactored to support both multiplexing (mux) and demultiplexing (demux) operations with independent configurations.
Key changes:
- Added demux subcommand with unicast and multicast routing modes
- Refactored tray state to separate mux-specific and demux-specific configurations
- Implemented runtime-switchable operation modes (Mux/Demux) in the system tray
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tray/state.rs | Refactored state to support both Mux and Demux operations with separate MuxState and DemuxState structures |
| src/tray/config.rs | Split configuration into nested MuxConfig and DemuxConfig structures with operation mode selection |
| src/tray/app.rs | Updated tray menu to support operation mode switching and mode-specific configuration menus |
| src/main.rs | Added Demux CLI subcommand with arguments for primary controller, sinks count, mode, hide, spoof, and rumble |
| src/mux_manager.rs | Added tag parameter to virtual gamepad creation for device identification |
| src/evdev_helpers.rs | Added tag support to virtual device naming and neutral gamepad event generation utility |
| src/demux_runtime.rs | Implemented demux runtime with input/FF loops and DemuxRumbleTarget enum |
| src/demux_modes/mod.rs | Defined DemuxModeType enum and DemuxMode trait for routing implementations |
| src/demux_modes/unicast.rs | Implemented unicast mode routing primary to active virtual gamepad with Mode button cycling |
| src/demux_modes/multicast.rs | Implemented multicast mode broadcasting primary input to all virtual gamepads |
| src/demux_modes/helpers.rs | Re-exported shared helpers from mux_modes |
| src/demux_manager.rs | Implemented demux session management with multiple virtual device and FF thread handling |
| README.md | Added documentation for demux modes, CLI usage, and configuration examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use the ? operator to propagate errors when opening virtual devices, ensuring consistent error handling and avoiding panics.
…andles - Move ScopedDeviceHider into MuxHandle and DemuxHandle to ensure device hiding persists for the session lifetime. - Suppress dead_code linter warnings for hider fields, as they are intentionally unused but required for correct behavior.
by removing fragile device matching in favor of new devpath api
via cargo upgrade --incompatible allow
don't feel the need to deviate from the gilrs error type just yet
Screencast_20260108_173024.webm
Related: