Skip to content

Restore responsive Steam Deck trackpad haptics - #1466

Open
LavX wants to merge 24 commits into
Valkirie:mainfrom
LavX:fix/trackpad-haptic-regression
Open

LavX wants to merge 24 commits into
Valkirie:mainfrom
LavX:fix/trackpad-haptic-regression

Conversation

@LavX

@LavX LavX commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Restore movement haptics for Steam Deck trackpad mouse actions.
  • Dispatch physical click feedback before mapped actions so it feels immediate.
  • Keep movement on the short pulse and click press/release feedback on the native click waveform.
  • Preserve independent left and right routing and per-action mode and strength settings.
  • Default physical trackpad clicks to press and release at High in built-in layouts.

Why

The final version of #1461 routed movement feedback only through touchpad output actions, while the desktop layout uses mouse actions for pad movement. Physical click feedback was also dispatched after mapped action processing, and movement used the same waveform as clicks. This removed movement feedback and made clicks feel delayed and harder to trigger.

Testing

  • Built the solution locally with 0 errors. The build reports 293 existing warnings.
  • Manually tested on a Steam Deck. Movement feedback works on both pads, click feedback is immediate, and press/release feedback follows the per-action settings.

Summary by CodeRabbit

  • New Features

    • Added independent left and right touchpad haptic feedback for clicks and movement.
    • Haptic feedback now respects configured actions, shift conditions, modes, and strength settings.
    • Added direct touch feedback for supported Steam controller touchpads.
    • Added a movement-haptics toggle for compatible mouse, scroll, and touchpad mappings.
  • Bug Fixes

    • Physical touchpad clicks no longer trigger inappropriate haptic commands.
    • Touchpad haptic state resets correctly when controllers become unavailable or modes change.
  • Configuration

    • Default keyboard, mouse, and desktop layouts now provide bilateral, high-strength touchpad feedback.

Valkirie and others added 20 commits July 30, 2026 15:48
Registers firmware 0x1100 as supported and improves initialization logging with hexadecimal firmware, board ID, and support status.
Avoids initialization-time setting side effects, applies the initial VIIPER and HID state explicitly, and disposes the virtual target on disconnect. Updates the bundled VIIPER library.
)

KX.init() built the RAPL register address by concatenating the full
MCHBAR base string with the register offset: `mchbar = address +
pnt_limit` with address = "0xfedc0000" produced "0xfedc000059", and
get/set_limit then appended "a0"/"a4" to form "0xfedc000059a0" -- a
48-bit physical address that isn't mapped, so every /wrmem16 TDP write
was silently dropped and PL1/PL2 never changed.

The base string carries the MCHBAR base in its high 16 bits (low 16 are
zero), so take Substring(0,6) ("0xfedc") before appending the offset,
yielding the correct 0xFEDC59A0 / 0xFEDC59A4. Verified live on an
OneXPlayer X2 (Panther Lake): writing the RAPL register now reads back
the expected value and HWiNFO reflects the new PL1/PL2.

Regression from 4b94f3a, which switched mchbar_addresses from the full
register form ("0xfedc59A0") to the base form without updating the
concatenation in init(). This affected the KX MMIO path on all Intel
devices; it went unnoticed because most Intel handhelds override TDP via
OEM/EC paths, while the X2 relies on the KX MMIO path.

Co-authored-by: gsxdsm <gsxdsm@noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: gsxdsm <gsxdsm@noreply.github.com>
Co-authored-by: gsxdsm <gsxdsm@noreply.github.com>
* Fix XG Mobile hotkey toggle and capability detection

* Synchronize ASUS ACPI control calls

* Cache XG Mobile support and toggle state

* Centralize ASUS device capability detection

Add a shared ASUS device base that opens ACPI and detects XG Mobile support, then reuse it for ROG Ally devices and simplify GPU command state handling.

---------

Co-authored-by: slekrem <noreply@opendexter.dev>
Co-authored-by: Lesueur Benjamin <benjamin.lesueur@live.com>
…ng PS/2 Service (Valkirie#1459)

* Block firmware Win+G without disabling PS/2

Fixes Valkirie#1444

Fixes Valkirie#1453

* Harden Win+G blocker against stuck modifiers and failed injection

Prune keys the hardware no longer reports as held before matching. A KeyUp
missed across the secure desktop left a modifier stuck down, which suppressed
the action key permanently.

Move SendInput off updateLock so the hook callback cannot overrun
LowLevelHooksTimeout and the settings thread never waits on it, and log
partial or failed sends instead of silently falling back to opening Start.

Skip the dummy keystroke for Control and Shift, which do not activate
anything on release.

Only migrate the PS/2 setting once the service is restored, so a failing
restore no longer re-enables the blocker on every launch, and post the
restart prompt at idle so it is not raised during MainWindow construction.

* Fix Win+G blocker review issues

* Inline MSI Firmware Workaround into InputsManager

* Move the Firmware Specific Workaround into a Helper to keep InputsManager Clean.

* Document MSI firmware workaround methods

Co-authored-by: Codex <codex@openai.com>

* Clean up partial MSI input injection

Co-authored-by: Codex <codex@openai.com>

* Use proper manager query logic/structure

Register the settings change handler only after SettingsManager initialization and query the MSI Claw workaround setting at that point, avoiding premature settings access.

---------

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Lesueur Benjamin <benjamin.lesueur@live.com>
* Add configurable DualSense touchpad actions

* Address DualSense touchpad review feedback

* Reduce DualSense touchpad integration scope

* Validate DualSense swipe duration

* Scope touchpad settings to button mappings

* Support touchpad gestures from all mappings

* Add Steam trackpad haptic feedback

* Fix Steam trackpad haptic edge cases

* Fix trackpad movement edge cases

* Refactor touchpad mappings into TouchpadActions

* Add touchpad gyro outputs to Quick Profiles

* Restrict supported mapping action types

Adds per-mapping action type support and updates the action settings UI to disable unsupported options. Also broadens button visibility handling for applicable action types.

* Add trigger-to-button threshold control

Expose the axis-to-button threshold slider for trigger mappings and update related visibility notifications.

* Format response curve Y-axis values

Round response curve axis values to one decimal place before formatting, ensuring displayed labels match the intended precision.

* Add touchpad visualizer and DualShock targets

Adds touchpad coordinate visualization and live property updates, enables coordinate targets for DualShock 4 controllers, reorganizes mapping properties, and updates touchpad labels and designer preview visibility.

* Synchronize profile and layout updates

Protects concurrent access to profile collections and layout data during mutations, sanitization, and serialization by introducing profile synchronization and locking layout operations.

* Refine touchpad gesture mappings

Replace coordinate and center-click mappings with unified touchpad click/touch gestures, including finger-aware DualSense output and updated controller targets.

* Remove touchpad axis mapping targets

Stop adding touchpad axis targets to button and trigger mapping target lists, including matching logic for axis actions.

* Support dual touchpad output mapping

Add configurable left/right touchpad fingers for mapped actions and preserve simultaneous touch output across DualShock 4 and DualSense targets.

* Simplify DualSense touchpad click handling

Use output touch activity to select the click finger, remove synthetic touch coordinates and redundant axis updates, and simplify click sequencing state.

* Map DualSense mute to B5

Replace the removed MicrophoneMute flag with B5 in the dummy controller and DualSense target while preserving the mute button bit mapping.

* Fix controller settings visibility

Corrects Steam Deck and trackpad settings panel visibility, safely handles missing controllers, and marks trackpad touch/click flags as UI-only.

* Centralize touchpad output handling

Move touchpad frame state and output application into TouchpadActions, simplifying LayoutManager processing while preserving axis accumulation, gesture prioritization, and haptic updates.

* Refine touchpad mapping and haptics

Unifies haptic handling across controllers, adds touchpad axis deadzone support, simplifies touchpad output processing, and removes the global trackpad haptics setting in favor of per-action configuration.

* Simplify touchpad haptic configuration

Remove per-action global haptic override handling and UI, assign default touchpad click and axis haptic settings, and enable Steam Controller gesture targets.

* Add optional touchpad coordinate mapping

Allow touchpad click and touch actions to optionally use configured coordinates, expose the setting in the action UI, and enable coordinate-based default mappings.

---------

Co-authored-by: gsxdsm <gsxdsm@noreply.github.com>
Co-authored-by: Lesueur Benjamin <benjamin.lesueur@live.com>
Release the synthetic left-control key when a physical AltGr key is released and left Control is no longer physically held.
Include left and right touchpad X/Y axes in AxisState.TrueAxis so touchpad inputs are treated as true axes alongside sticks and triggers.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ca85fbf6-c461-4016-ac35-f07b30e65855

📥 Commits

Reviewing files that changed from the base of the PR and between 6377469 and 52c475f.

📒 Files selected for processing (1)
  • HandheldCompanion/ViewModels/Layout/Mappings/MappingViewModel.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • HandheldCompanion/ViewModels/Layout/Mappings/MappingViewModel.cs

Included review availability: Your plan includes up to 4 reviews per rolling hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Touchpad click and movement haptics now use independent left and right action profiles. Profiles resolve shift conditions, haptic modes, and strengths. Default layouts configure bilateral feedback. Movement haptics have dedicated mapping controls.

Changes

Touchpad haptic processing

Layer / File(s) Summary
Haptic profiles and default mappings
HandheldCompanion/Misc/Layout.cs, HandheldCompanion/Misc/LayoutTemplate.cs
Action factories and default layouts now carry haptic strengths. Default layouts configure bilateral, high-strength touchpad feedback.
Click haptic resolution and output
HandheldCompanion/Actions/TouchpadActions.cs, HandheldCompanion/Actions/IActions.cs, HandheldCompanion/Controllers/Steam/NeptuneController.cs, HandheldCompanion/Managers/LayoutManager.cs
Click sources and transitions are tracked independently. Active profiles determine press and release strengths. Physical clicks bypass generic haptic processing. NeptuneController sends direct left or right motor commands.
Movement haptic selection and wiring
HandheldCompanion/Actions/TouchpadActions.cs, HandheldCompanion/Managers/LayoutManager.cs
Movement haptics select eligible mapped actions, maintain separate left and right state, reset inactive state, and run during touchpad axis processing.
Movement haptic mapping controls
HandheldCompanion/ViewModels/Layout/Mappings/MappingViewModel.cs, HandheldCompanion/Views/Pages/ActionSettingsPage.xaml
Mapping properties identify movement-haptic actions. The settings page shows an enable toggle for those mappings and retains the haptic-mode selector for other mappings.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 52c47

The change restores responsive Steam Deck trackpad movement and click haptics while preserving per-action routing and settings; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant LayoutManager
  participant TouchpadActions
  participant NeptuneController
  participant TouchpadMotor
  LayoutManager->>TouchpadActions: Process click or movement input
  TouchpadActions->>NeptuneController: Send selected haptic strength
  NeptuneController->>TouchpadMotor: Map strength to amplitude
  NeptuneController->>TouchpadMotor: Apply left or right motor feedback
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: restoring responsive Steam Deck trackpad haptics.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LavX
LavX marked this pull request as ready for review August 15, 2026 21:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a83b286b85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread HandheldCompanion/Actions/TouchpadActions.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23231bc993

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread HandheldCompanion/Actions/TouchpadActions.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f35c6f43b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread HandheldCompanion/Actions/TouchpadActions.cs Outdated
Comment thread HandheldCompanion/Managers/LayoutManager.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6377469545

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread HandheldCompanion/ViewModels/Layout/Mappings/MappingViewModel.cs Outdated
@LavX

LavX commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@Valkirie, I have addressed the latest review feedbacks and pushed the updates. The project builds with 0 errors, and the trackpad movement and click haptics were tested on a Steam Deck. Could you please review it and merge it if everything looks good? Thank you.

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.

5 participants