Repository navigation
Conversation
…ction from -1 to 1, so 0.5 means half. Before, any non-zero value pushed the stick all the way
In speed mode, the stick follows how fast relative input (like the mouse) moves and returns to the center when it stops. This suits games where the stick sets how fast you turn, instead of where you aim. Accumulate mode (the existing behavior) stays the default, so profiles are unchanged.
…eTriggerCenter is no longer needed and is kept as a no-op.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Cancelling the mapping dialog leaves profile edits in place, allowing mismatched press and reverse actions to be persisted on a later save.
5 open issues
What changed in this PR
This PR improves mouse-to-stick aiming for games where stick deflection controls turn speed, adding configurable speed tracking and shared stick mixing.
Changes:
- Adds Speed mode, fractional exact values, and stick contribution mixing.
- Adds opt-in raw mouse input and revises cursor-based movement measurement.
- Updates Hold/reverse-mapping editing, reset controls, API documentation, and unit tests.
| File | Description |
|---|---|
| Support/Key2Joy.Tests/Core/Mapping/Actions/Input/StickSpeedTrackerTests.cs | Tests speed calculation, decay, and output curves. |
| Support/Key2Joy.Tests/Core/Mapping/Actions/Input/GamePadStickMixerTests.cs | Tests contribution mixing, clamping, and resets. |
| Key2Joy.App/UserControls/MappingControl.xaml.cs | Adds confirmation for reverse-mapping removal. |
| Key2Joy.App/UserControls/Actions/Input/GamePadStickActionControl.xaml.cs | Connects speed settings and Hold-aware reset options. |
| Key2Joy.App/UserControls/Actions/Input/GamePadStickActionControl.xaml | Adds speed controls and fractional exact-value inputs. |
| Key2Joy.App/UserControls/Actions/ActionControl.xaml.cs | Propagates reverse-mapping state to action options. |
| Key2Joy.App/Pages/MainMappingPageViewModel.cs | Ensures newly created child mappings enter the profile. |
| Key2Joy.App/Pages/MainMappingPage.xaml.cs | Handles confirmed child-mapping removal. |
| Docs/Api/Input/GamePad.SimulateMove.md | Documents fractional parameters and corrects axis directions. |
| Core/Key2Joy.Core/Mapping/Triggers/Mouse/MouseMoveTriggerListener.cs | Revises movement measurement and integrates raw input. |
| Core/Key2Joy.Core/Mapping/Actions/Input/StickSpeedTracker.cs | Calculates windowed speed and stick output. |
| Core/Key2Joy.Core/Mapping/Actions/Input/StickSpeedTicker.cs | Schedules background speed updates. |
| Core/Key2Joy.Core/Mapping/Actions/Input/GamePadStickMixer.cs | Combines stick contributions and applies clamped output. |
| Core/Key2Joy.Core/Mapping/Actions/Input/GamePadStickInputMode.cs | Defines Accumulate and Speed modes. |
| Core/Key2Joy.Core/Mapping/Actions/Input/GamePadStickAxis.cs | Defines stick-axis identifiers. |
| Core/Key2Joy.Core/Mapping/Actions/Input/GamePadStickAction.cs | Implements fractional movement, mixing, and speed mode. |
| Core/Key2Joy.Core/Mapping/Actions/Input/GamePadResetAction.cs | Routes resets through gamepad state reset. |
| Core/Key2Joy.Core/LowLevelInput/SimulatedGamePad/SimulatedGamePad.cs | Clears mixer contributions during reset. |
| Core/Key2Joy.Core/LowLevelInput/RawMouseInput.cs | Adds a Windows Raw Input mouse reader. |
| Core/Key2Joy.Core/Config/ConfigState.cs | Adds the opt-in raw mouse setting. |
| Core/Key2Joy.Contracts/Mapping/Actions/IReverseMappingAwareOptionsControl.cs | Defines reverse-mapping awareness for option controls. |
Review effort: Balanced
…cumulation - Validate mapping edits on a draft and only apply them after the "remove child mappings" confirmation, so cancelling leaves the profile untouched. - Publish speed mode values while holding the speed lock, so a tick can't leave a stale value behind after disarm. - Store accumulated relative input per trigger listener instead of per action, so separate directional mappings (e.g. Mouse Move Left and Right) can fully undo each other again, like before the stick mixer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Heya! This makes mouse aiming via a virtual stick work properly for games where the stick controls turn speed rather than aim position. It was prompted by @domi811 trying to play WAR: Final Assault in MAME with mouse aim (discussion): horizontal aiming only turned in fixed steps, and sometimes flicked the wrong way.
What was wrong
100, or even1) gave full deflection, so mouse movement became "full speed for 25 ms" pulses.What changed
-1to1), in the editor and inGamePad.SimulateMove. Existing profiles keep working:±1is still full deflection, and larger values are clamped to it.GamePadStickMixercombines all mappings on a stick and only clamps the final value, so a press and its release always cancel out.Editor fixes found along the way:
Compatibility
No profile migration needed. Old profiles load and behave the same, minus the drift and stuck-stick bugs. All new options are opt-in.
Testing
This is some of the testing I did that's noteworthy:
warfab) with a mouse-aim profile: X in Speed mode, Y in Accumulate mode:mame warfab -joystick -nomouse -joystick_deadzone 0 -joystick_saturation 1Related issues