Skip to content

Add a "No Accel" mode#83

Merged
Gnarus-G merged 3 commits intomainfrom
feat/noaccel-accel
Aug 3, 2025
Merged

Add a "No Accel" mode#83
Gnarus-G merged 3 commits intomainfrom
feat/noaccel-accel

Conversation

@Gnarus-G
Copy link
Owner

@Gnarus-G Gnarus-G commented Aug 3, 2025

This PR introduces a new "No Acceleration" (NoAccel) mode to the maccel system. This mode provides a direct 1:1 mapping between input and output sensitivity, effectively disabling any acceleration curves.

Key changes include:

  • Core Logic:

    • Defined NoAccel as a new AccelMode variant.
    • Added NoAccelCurveParams which is an empty struct, signifying no specific parameters for this mode. A _ffi_guard field is included for FFI safety.
    • Implemented __no_accel_sens_fun in the driver, which simply returns FIXEDPT_ONE (a sensitivity of 1.0), ensuring no acceleration is applied.
    • Updated AllParamArgs to correctly handle NoAccel mode, passing the empty NoAccelCurveParams.
  • CLI Enhancements:

    • Extended the maccel CLI to support NoAccel mode for setting and getting parameters.
    • set_all_no_accel and get_all_no_accel commands are now available, though setting parameters for this mode is a no-op as there are none.
  • Driver Integration:

    • Updated accel.h to include no_accel.h and add no_accel to the __accel_args union.
    • Modified accel_mode enum to include no_accel.
    • Integrated the __no_accel_sens_fun into the main sensitivity function.
  • TUI Integration:

    • Added a dedicated screen for NoAccel mode in the TUI, displaying its parameters (which are none) and a sensitivity graph.
    • The sensitivity graph for NoAccel mode dynamically adjusts its Y-axis bounds based on the SensMult parameter, ensuring a clear visualization of the 1:1 sensitivity.
  • Testing:

    • Added test_no_accel_acceleration to the driver tests to verify the correct behavior of the NoAccel mode, ensuring a constant sensitivity of 1.0.

This new mode provides a convenient way for users to disable acceleration entirely without needing to manually configure other modes to achieve a flat curve.

@Gnarus-G Gnarus-G self-assigned this Aug 3, 2025
@Gnarus-G Gnarus-G added the enhancement New feature or request label Aug 3, 2025
@vercel
Copy link

vercel bot commented Aug 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maccel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2025 6:10pm

Gnarus-G and others added 3 commits August 3, 2025 14:08
This commit introduces a new acceleration mode called 'No Acceleration'.
This mode effectively disables any acceleration curve, resulting in a
1:1 sensitivity mapping.

The changes include:
- Adding `NoAccel` to the `AccelMode` enum.
- Updating the `declare_params!` macro to support modes with no
  specific parameters, using a ZST for FFI safety.
- Implementing `set_all_no_accel` in `ParamStore` and `SysFsStore`
  (as a no-op, since there are no parameters to set).
- Extending the CLI to allow setting and getting parameters for the
  `NoAccel` mode.
- Adding the `no_accel` mode to the kernel driver, including its
  sensitivity function which always returns `FIXEDPT_ONE`.
- Adding a test case for the `no_accel` mode in the driver tests.
- Integrating the `NoAccel` mode into the TUI, providing a basic
  sensitivity graph for it.

This new mode provides a clear way to disable acceleration without
needing to set other curve parameters to specific values that mimic
no acceleration.
🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
@Gnarus-G Gnarus-G force-pushed the feat/noaccel-accel branch from 98de140 to eae9fdc Compare August 3, 2025 18:09
@Gnarus-G Gnarus-G merged commit 06932a3 into main Aug 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant