diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f4c448..bf64153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,32 @@ changes to the sysfs surface, minor versions add supported wheels or new attributes, patch versions are bug fixes and documentation. Pre-1.0 the contract is "it works on RS50 and G Pro as listed here". +## Unreleased + +**An RS Shifter & Handbrake is never dropped from `wheel_accessory`.** When +the accessory's name could not be read, the driver left it out of the list +and only its settings showed it was there. It is now listed under the fixed +name `RS Shifter & Handbrake` in that case. + +**The apps no longer mistake another accessory for the Shifter & Handbrake.** +Since 0.43.0 the attribute lists every attached accessory. The apps took any +list that was not `none` as the Shifter & Handbrake, so an H-Shifter or a +Racing Adapter on its own switched the handbrake settings on. They now look +for the Shifter & Handbrake's own entry. + +**Plain language, continued.** The per-game setup text in the apps and in +`docs/GAME_SETUP.md` is rewritten in short sentences. The per-axis view +toggles are now called "response", as in "Throttle response". + +**Specification corrections.** The FFB strength encoding is `Nm × 8192 - 1` +in both places it appears. The LIGHTSYNC slot name is 9 characters, as the +wheel accepts, not 8 or 15. The interface summary says which interface +carries HID++ and which carries the force stream. The RS50's force packets +are 64-byte reports with ID `0x01`. The SDK symbol counts were recounted +against the DLL (75 exports, 58 of them `logi*`) and the current game build +(59 of 63 lookups resolved). The sysfs identity attributes have their own +section in the reference and the wiki. + ## 0.43.0 - 2026-11-14 **The Logitech RS H-Shifter works on the RS50 and the G PRO.** Plug it into diff --git a/docs/DINPUT_ESCAPE.md b/docs/DINPUT_ESCAPE.md index d692aa8..4dccc99 100644 --- a/docs/DINPUT_ESCAPE.md +++ b/docs/DINPUT_ESCAPE.md @@ -26,7 +26,7 @@ Everything here was measured on an RS50 (`046d:c276`) in Assetto Corsa EVO on |---|---| | Our shim registers the SDK | fixed; it was broken from 0.27.1 to 0.34.x by a quoting bug | | The game loads the SDK | yes, verified by signature and loaded | -| The game resolves the SDK API | yes, 56 of 59 symbols | +| The game resolves the SDK API | yes, 59 of the 63 symbols it looks up; the other 4 were never exported (counted 2026-11-14) | | The SDK opens the wheel | yes, interface `mi_02`, the TrueForce interface | | The SDK writes to the wheel | **yes**, on endpoint 3, once the range questions are answered locally (see 2026-08-12 below) | | The game streams torque | **yes**, `logiTrueForceSetTorqueKF` at ~190/sec | @@ -186,7 +186,7 @@ backend, and raw HID stops being a trade-off. - **The missing viscosity API.** The game resolves `logiTrueForceGetViscosity`, `GetViscosityMax` and `SetViscosity`, and all three fail. This is not the blocker. `1_3_11` and `1_3_12` have identical - 76-symbol export sets, and neither has them. So no shipped G HUB provides + 75-symbol export sets, and neither has them. So no shipped G HUB provides them, and Windows users are equally without. The game probes optionally. - **A G HUB agent.** The SDK and the effect driver both enumerate HID themselves. Neither references `LGHUB`, a pipe, or a socket to one. diff --git a/docs/GAME_SETUP.md b/docs/GAME_SETUP.md index cff39f5..cb4eab8 100644 --- a/docs/GAME_SETUP.md +++ b/docs/GAME_SETUP.md @@ -149,9 +149,9 @@ the app's Setup page afterwards. ## What each recipe means -- **Install the shim.** Stage Logitech's signed SDK DLLs into the game's Proton prefix, from the app's Setup page or `tools/install-tf-shim.sh`. Install the TrueForce shim once, from the app's Setup page; launch options `logi-launch %command%` (it turns raw HID on, stages the proxy that answers the SDK's rotation question, without which the stock library stops steering and force on track, and everything else this game needs); turn Steam Input off. No engine-note texture merge here: ACC produces its own TrueForce audio, so the merge is not wired for it. -- **On a wheel with no SDK TrueForce.** Leave PROTON_ENABLE_HIDRAW unset: on this wheel it costs you force feedback. For haptics, turn this game on under Simulated TrueForce; logi-launch puts the telemetry relay in the game's prefix and starts the daemon for you, and that route is confirmed working on a G923. Steam Input off. -- **Launch via logi-ffb.** Launch options `logi-launch %command%` (it keeps raw HID off, runs the logi-ffb helper and puts the telemetry relay in the game's prefix for you); Steam Input off. Simulated TrueForce also needs the community rF2SharedMemoryMapPlugin installed in the game. +- **Install the shim.** Stage Logitech's signed SDK DLLs into the game's Proton prefix, from the app's Setup page or `tools/install-tf-shim.sh`. Install the TrueForce shim once, from the app's Setup page. Set the launch options to `logi-launch %command%`. logi-launch turns raw HID on. It stages the proxy that answers the SDK's rotation question. Without that proxy, the stock library stops steering and force on track. It also sets up everything else this game needs. Turn Steam Input off. There is no engine-note texture merge here. ACC produces its own TrueForce audio, so the merge is not wired for it. +- **On a wheel with no SDK TrueForce.** Leave PROTON_ENABLE_HIDRAW unset. On this wheel it costs you force feedback. For haptics, turn this game on under Simulated TrueForce. logi-launch puts the telemetry relay in the game's prefix. It also starts the daemon for you. That route is confirmed working on a G923. Turn Steam Input off. +- **Launch via logi-ffb.** Set the launch options to `logi-launch %command%`. logi-launch keeps raw HID off. It runs the logi-ffb helper. It puts the telemetry relay in the game's prefix for you. Turn Steam Input off. Simulated TrueForce also needs the community rF2SharedMemoryMapPlugin. Install that plugin in the game. - **Nothing to do.** The wheel is an ordinary Linux force feedback device. The game drives it directly. ## Confidence diff --git a/docs/PROTOCOL_SPECIFICATION.md b/docs/PROTOCOL_SPECIFICATION.md index 36a90d1..cbf5afa 100644 --- a/docs/PROTOCOL_SPECIFICATION.md +++ b/docs/PROTOCOL_SPECIFICATION.md @@ -475,14 +475,14 @@ All non-calibration commands use Short HID++ (`0x10`) with device index `0xFF`. ``` Set: 10 FF 16 2D [Value_Hi] [Value_Lo] 00 ``` -**Encoding**: Value = Nm × 8192 (range 1.0-8.0 Nm with 0.1 Nm steps) +**Encoding**: Value = Nm × 8192 - 1, rounded down (range 1.0-8.0 Nm with 0.1 Nm steps). This is the same formula as the compat-mode table in section 5.1. | Value | Nm | Formula | |-------|-----|---------| -| `0x1FFF` | 1.0 Nm | 1.0 × 8192 ≈ 8191 | -| `0x4FFF` | 2.5 Nm | 2.5 × 8192 ≈ 20479 | -| `0x7FFF` | 4.0 Nm | 4.0 × 8192 ≈ 32767 | -| `0xC998` | 6.3 Nm | 6.3 × 8192 ≈ 51608 | +| `0x1FFF` | 1.0 Nm | 1.0 × 8192 - 1 = 8191 | +| `0x4FFF` | 2.5 Nm | 2.5 × 8192 - 1 = 20479 | +| `0x7FFF` | 4.0 Nm | 4.0 × 8192 - 1 = 32767 | +| `0xC998` | 6.3 Nm | 6.3 × 8192 - 1 ≈ 51608 | | `0xFFFF` | 8.0 Nm | Maximum torque | **Driver Formula**: `value = (uint16_t)(nm * 8191.875)` or `value = nm * 0xFFFF / 8.0` @@ -925,7 +925,7 @@ A few behaviors observed in compat mode look like driver problems. They are firm - **Default steering angle is 90°**: the factory default angle in compat mode is 90°, not the wheel's 1080° hardware maximum. This is correct firmware behavior. To set it from Linux: first write `wheel_profile=0`, then write `wheel_range=`. Or set it from the OLED by editing the active onboard profile. - **LIGHTSYNC works in compat mode**: feature `0x807A` is advertised in compat at the same index that discovery picks up in native. `wheel_led_*` writes drive the LED strip end-to-end (verified 2026-04-29). An earlier draft of this document claimed otherwise. That claim was incorrect. -### 5.3 Sub-device Addressing (HID++ dev_idx 0x01 / 0x02 / 0x05) +### 5.3 Sub-device Addressing (HID++ dev_idx 0x01 to 0x05; the index is the port) Cross-capture census (2026-07-02, all 62 captures): the wheel base sits at dev_idx `0xff` (~100k packets each way). Besides it, three sub-devices @@ -1210,7 +1210,7 @@ again. | Feature | G920/G923 | RS50 | |---------|-----------|------| | FFB Method | HID++ Feature 0x8123 | Dedicated endpoint 0x03 | -| FFB Commands | Via HID++ FAP messages | Raw HID output reports (05 XX) | +| FFB Commands | Via HID++ FAP messages | Raw 64-byte output reports, report ID 0x01 (section 4) | | Report ID | 0x11/0x12 | 0x01 (custom) | | Sequence Field | 2 bytes | 1 byte | | Max Rotation | 900° | 2700° | @@ -1253,7 +1253,7 @@ queue-saturation failures). But a minimal 0x8123-fn2 force-target sender remains an untested alternative transport. It could matter if the wheel's FFB-filter smoothing turns out to apply only to that path. -**Interface initialization**: FFB must be initialized on Interface 1 (HID++), not Interface 0 (joystick). Interface 0 has no HID++ support. +**Interfaces**: HID++ lives on Interface 1. That is where feature `0x8123` and the settings (strength, range, filters) are written. The endpoint `0x03` force stream, and the session init that opens it (see `TRUEFORCE_PROTOCOL.md`), live on Interface 2. Interface 0 (joystick) carries neither and has no HID++ support. --- @@ -1498,7 +1498,7 @@ Interpretation: May enumerate effect types or zone capabilities (appears to be z │ │ │ │ │ │ │ │ │ └── LED count (10) │ │ │ └───── Unknown (1) - │ │ └──────── Max name length (8 characters) + │ │ └──────── Max name length as advertised (8; the wheel accepts 9, see 9.6) │ └─────────── Number of slots (5) └────────────── Number of slots (5, duplicated) ``` @@ -1701,7 +1701,10 @@ Custom slots can have user-defined names (shown in G Hub UI). 12 FF [idx] 4C [slot] [len] [ASCII name, null-padded]... ``` -Name is up to 15 ASCII characters. Default names: "CUSTOM 1" through "CUSTOM 5". +The wheel accepts a name of up to 9 ASCII characters and stores it in upper +case (hardware-verified 2026-07-16). fn0 advertises 8. A longer name is +refused by the wheel, which the driver reports as `EIO`. Default names: +"CUSTOM 1" through "CUSTOM 5". ### 9.7 Protocol Examples diff --git a/docs/SDK_ABI_NOTES.md b/docs/SDK_ABI_NOTES.md index 3fe7868..1645b7a 100644 --- a/docs/SDK_ABI_NOTES.md +++ b/docs/SDK_ABI_NOTES.md @@ -126,9 +126,10 @@ that added this section. ## Which SDK a game uses -Grep the game binary. Assetto Corsa Competizione resolves 56 symbols from -the TrueForce SDK, including all four rotation getters. It resolves none at -all from the legacy Steering Wheel SDK: +Grep the game binary. Assetto Corsa Competizione resolves 59 symbols from +the TrueForce SDK (57 `logi*` calls plus `dllOpen` and `dllClose`, counted +2026-11-14 on the current build), including all four rotation getters. It +resolves none at all from the legacy Steering Wheel SDK: ```bash strings -n 6 AC2-Win64-Shipping.exe | grep -E "^(logi|Logi|dll)[A-Za-z]" | sort -u diff --git a/docs/SYSFS_API.md b/docs/SYSFS_API.md index ffdb4c5..cad6b11 100644 --- a/docs/SYSFS_API.md +++ b/docs/SYSFS_API.md @@ -1000,6 +1000,8 @@ G PRO. Reports are welcome (issue tracker).** echo 7 > wheel_rev_level ``` +## Identity + ### wheel_serial **Access**: Read-only **Values**: 12-character device serial @@ -1032,8 +1034,8 @@ Presence signal for the base's optional accessories: the **RS Shifter & Handbrake**, the **RS H-Shifter** and the **Logitech Racing Adapter**. They plug into the base's USB-A ports. The attribute lists the attached accessories by name, separated by commas, always in this order: the RS -Shifter & Handbrake (its own HID++ device name), `RS H-Shifter`, `Racing -Adapter`. It reads `none` when no accessory is attached. Unlike the +Shifter & Handbrake (its own HID++ device name, or `RS Shifter & Handbrake` +when that name could not be read), `RS H-Shifter`, `Racing Adapter`. It reads `none` when no accessory is attached. Unlike the pedal/handbrake attributes below, this never returns an error. It exists precisely so apps can check for an accessory without inferring presence from another attribute's error code. diff --git a/docs/TRUEFORCE_PROTOCOL.md b/docs/TRUEFORCE_PROTOCOL.md index 4bf3b55..a1b009b 100644 --- a/docs/TRUEFORCE_PROTOCOL.md +++ b/docs/TRUEFORCE_PROTOCOL.md @@ -496,7 +496,7 @@ Used for constant force values with extended precision. | `userspace/libtrueforce/src/tf_init_data.h` | 68 canonical init packets, auto-generated from capture, sent twice at session bring-up | | `userspace/libtrueforce/src/session.c` | `logitf_session_ensure()` opens the hidraw node and runs the two-pass init | | `userspace/libtrueforce/src/stream.c` | 1000 Hz timerfd loop (`LOGITF_TF_PKT_HZ`), 13-slot rolling window, `logitf_stream_push_s16()` / `_clear()` / `_start/stop()` | -| `userspace/libtrueforce/include/trueforce.h` | Mirrors the 62 exports of `trueforce_sdk_x64.dll` (Windows SDK) so a Linux app can call the same API surface | +| `userspace/libtrueforce/include/trueforce.h` | Declares the 58 `logi*` functions that `trueforce_sdk_x64.dll` (Windows SDK 1.3.11, 75 exports in all) exports, so a Linux app can call the same API surface. The DLL's other 17 exports are `dllOpen`/`dllClose`, two COM registration stubs and 13 mangled C++ internals | ## Open Items @@ -545,6 +545,6 @@ other call to Logitech's own library and answers only the rotation getters. Signatures for those are in `docs/SDK_ABI_NOTES.md`, taken from the library's machine code rather than from any header. -Assetto Corsa Competizione resolves 56 symbols from this SDK, including all +Assetto Corsa Competizione resolves 59 symbols from this SDK, including all four rotation getters, and none at all from the older Steering Wheel SDK. So for that title this is the right library to answer through. diff --git a/mainline/hid-logitech-hidpp.c b/mainline/hid-logitech-hidpp.c index 4fe5e97..e405a28 100644 --- a/mainline/hid-logitech-hidpp.c +++ b/mainline/hid-logitech-hidpp.c @@ -8727,9 +8727,9 @@ static int hidpp_dd_read_device_name(struct hidpp_device *hidpp, u8 dev_idx, * Read the RS Shifter & Handbrake accessory's own DeviceNameType (0x0005) * name into ff->accessory_name, once the accessory has been confirmed at * dev_idx (see hidpp_dd_discover_settings_features). Best-effort: any - * failure leaves accessory_name empty, which wheel_accessory_show reports - * as "none" - the same as a genuinely absent accessory, since without a - * name the sysfs attribute cannot usefully distinguish the two anyway. + * failure leaves accessory_name empty, and wheel_accessory_show then lists + * the accessory under the fixed name "RS Shifter & Handbrake" instead, so a + * confirmed accessory is never reported as absent. */ static void hidpp_dd_query_accessory_name(struct hidpp_dd_ff_data *ff, u8 dev_idx) { @@ -8768,10 +8768,9 @@ static void hidpp_dd_adopt_shifter_handbrake(struct hidpp_dd_ff_data *ff, * 2026-10-29). Only called for a candidate already known to answer, so the * normal transport timeout is fine: a silent index never gets this far. * - * On a hit this records the feature index and, unless an accessory with a - * queried name already owns it, the wheel_accessory text. The caller - * publishes h_shifter_dev_idx itself, last, because that is what the - * readers gate on. + * On a hit this records the feature index. The caller publishes + * h_shifter_dev_idx itself, last, because that is what the readers gate + * on, and wheel_accessory_show derives its text from that index. */ static bool hidpp_dd_probe_h_shifter(struct hidpp_dd_ff_data *ff, u8 cand) { @@ -15356,14 +15355,14 @@ static ssize_t wheel_accessory_show(struct device *dev, jiffies + HIDPP_DD_ACCESSORY_RESCAN_INTERVAL); queue_work(ff->wq, &ff->accessory_rescan_work); } - has_shifter = READ_ONCE(ff->shifter_dev_idx) != HIDPP_DD_FEATURE_NOT_FOUND && - ff->accessory_name[0]; + has_shifter = READ_ONCE(ff->shifter_dev_idx) != HIDPP_DD_FEATURE_NOT_FOUND; has_h_shifter = READ_ONCE(ff->h_shifter_dev_idx) != HIDPP_DD_FEATURE_NOT_FOUND; has_adapter = READ_ONCE(ff->adapter_dev_idx) != HIDPP_DD_FEATURE_NOT_FOUND; if (!has_shifter && !has_h_shifter && !has_adapter) return sysfs_emit(buf, "none\n"); if (has_shifter) - len += sysfs_emit_at(buf, len, "%s", ff->accessory_name); + len += sysfs_emit_at(buf, len, "%s", ff->accessory_name[0] ? + ff->accessory_name : "RS Shifter & Handbrake"); if (has_h_shifter) len += sysfs_emit_at(buf, len, "%sRS H-Shifter", len ? ", " : ""); if (has_adapter) diff --git a/userspace/logi-wheel/crates/logi-wheel-core/src/device.rs b/userspace/logi-wheel/crates/logi-wheel-core/src/device.rs index a67d9e0..1c45e05 100644 --- a/userspace/logi-wheel/crates/logi-wheel-core/src/device.rs +++ b/userspace/logi-wheel/crates/logi-wheel-core/src/device.rs @@ -822,16 +822,18 @@ impl Device { } } + /// The RS Shifter & Handbrake's entry in `wheel_accessory`, or `None` + /// when the attribute is missing, unreadable, `none`, or lists only + /// other accessories. The driver lists every attached accessory, + /// comma-separated (`RS Shifter & Handbrake, RS H-Shifter, Racing + /// Adapter`), so the entry has to be picked out: an H-Shifter or a + /// Racing Adapter on its own must not light up the handbrake settings. pub fn accessory_name(&self) -> Option { if !self.io.exists("wheel_accessory") { return None; } let raw = self.io.read("wheel_accessory").ok()?; - let t = raw.trim(); - if t.is_empty() || t == "none" { - return None; - } - Some(t.to_string()) + shifter_handbrake_entry(&raw).map(str::to_string) } pub fn accessory_attached(&self) -> Option { @@ -839,11 +841,10 @@ impl Device { return None; } let raw = self.io.read("wheel_accessory").ok()?; - let t = raw.trim(); - if t.is_empty() { + if raw.trim().is_empty() { return None; } - Some(t != "none") + Some(shifter_handbrake_entry(&raw).is_some()) } pub fn write(&self, attr: &str, v: &Value) -> Result<(), Error> { @@ -914,6 +915,21 @@ impl Device { } } +/// The RS Shifter & Handbrake's entry in a `wheel_accessory` value, which is +/// `none` or a comma-separated list of accessory names. The entry is whatever +/// is not one of the two fixed names the driver uses for the other +/// accessories: normally the device's own HID++ name, `RS Shifter & +/// Handbrake`, but the driver may report a firmware variant of it. +fn shifter_handbrake_entry(raw: &str) -> Option<&str> { + let t = raw.trim(); + if t.is_empty() || t == "none" { + return None; + } + t.split(',') + .map(str::trim) + .find(|e| !e.is_empty() && *e != "RS H-Shifter" && *e != "Racing Adapter") +} + #[cfg(test)] mod tests { use super::*; @@ -1093,6 +1109,26 @@ mod tests { assert_eq!(d.read_supported("wheel_handbrake_curve").unwrap(), None); } + #[test] + fn handbrake_settings_stay_hidden_when_only_other_accessories_are_attached() { + // Since the driver lists every attached accessory, an H-Shifter or a + // Racing Adapter alone must not count as the Shifter & Handbrake. + for list in ["RS H-Shifter", "Racing Adapter", "RS H-Shifter, Racing Adapter"] { + let d = dev_with_accessory(Some(list)); + assert_eq!(d.accessory_attached(), Some(false), "{list}"); + assert_eq!(d.accessory_name(), None, "{list}"); + assert!(!d.available("wheel_handbrake_sensitivity"), "{list}"); + } + } + + #[test] + fn handbrake_settings_are_available_with_the_accessory_in_a_list() { + let d = dev_with_accessory(Some("RS Shifter & Handbrake, RS H-Shifter, Racing Adapter")); + assert_eq!(d.accessory_attached(), Some(true)); + assert_eq!(d.accessory_name().as_deref(), Some("RS Shifter & Handbrake")); + assert!(d.available("wheel_handbrake_sensitivity")); + } + #[test] fn handbrake_settings_are_available_with_the_accessory_attached() { let d = dev_with_accessory(Some("RS Shifter & Handbrake")); diff --git a/userspace/logi-wheel/crates/logi-wheel-core/src/games.rs b/userspace/logi-wheel/crates/logi-wheel-core/src/games.rs index 203b57e..35db513 100644 --- a/userspace/logi-wheel/crates/logi-wheel-core/src/games.rs +++ b/userspace/logi-wheel/crates/logi-wheel-core/src/games.rs @@ -500,20 +500,13 @@ impl GameCompat { { // An SDK title with no telemetry: the simulated route below // has nothing to synthesise from, so it must not be offered. - "Leave PROTON_ENABLE_HIDRAW unset: on this wheel it costs you \ - force feedback, and this game publishes no telemetry yet, so \ - there is no simulated TrueForce to turn on either. Steam Input \ - off." + "Leave PROTON_ENABLE_HIDRAW unset. On this wheel it costs you force feedback. This game publishes no telemetry yet. So there is no simulated TrueForce to turn on either. Turn Steam Input off." } else if self.ffb == Ffb::TrueForceShim && !caps.sdk_trueforce { // Worded as "not available on this wheel" rather than "this // wheel has no SDK TrueForce", because it also covers the // unidentified wheel, about which we know only that we cannot // deliver it. - "Leave PROTON_ENABLE_HIDRAW unset: on this wheel it costs you \ - force feedback. For haptics, turn this game on under Simulated \ - TrueForce; logi-launch puts the telemetry relay in the game's \ - prefix and starts the daemon for you, and that route is \ - confirmed working on a G923. Steam Input off." + "Leave PROTON_ENABLE_HIDRAW unset. On this wheel it costs you force feedback. For haptics, turn this game on under Simulated TrueForce. logi-launch puts the telemetry relay in the game's prefix. It also starts the daemon for you. That route is confirmed working on a G923. Turn Steam Input off." } else { self.setup } @@ -653,7 +646,7 @@ pub const GAMES: &[GameCompat] = &[ // The last sentence is the answer to "why does AC EVO's card say // texture merge and this one does not": the merge is gated per // title in `LaunchPlan::for_game`, and ACC is not in the gate. - setup: "Install the TrueForce shim once, from the app's Setup page; launch options `logi-launch %command%` (it turns raw HID on, stages the proxy that answers the SDK's rotation question, without which the stock library stops steering and force on track, and everything else this game needs); turn Steam Input off. No engine-note texture merge here: ACC produces its own TrueForce audio, so the merge is not wired for it.", + setup: "Install the TrueForce shim once, from the app's Setup page. Set the launch options to `logi-launch %command%`. logi-launch turns raw HID on. It stages the proxy that answers the SDK's rotation question. Without that proxy, the stock library stops steering and force on track. It also sets up everything else this game needs. Turn Steam Input off. There is no engine-note texture merge here. ACC produces its own TrueForce audio, so the merge is not wired for it.", confidence: Confidence::Verified, }, GameCompat { @@ -667,7 +660,7 @@ pub const GAMES: &[GameCompat] = &[ // redline into the physics block, so unlike Competizione it needed // its own decoder rather than Assetto Corsa's unchanged. simulated_tf: SimTf::LiveNow("ac-evo"), - setup: "Install the TrueForce shim once, from the app's Setup page; launch options `logi-launch %command%` (it turns raw HID on, stages the proxy that answers the SDK's rotation question, without which the stock library stops steering and force on track, and everything else this game needs); turn Steam Input off.", + setup: "Install the TrueForce shim once, from the app's Setup page. Set the launch options to `logi-launch %command%`. logi-launch turns raw HID on. It stages the proxy that answers the SDK's rotation question. Without that proxy, the stock library stops steering and force on track. It also sets up everything else this game needs. Turn Steam Input off.", confidence: Confidence::Verified, }, GameCompat { @@ -676,10 +669,7 @@ pub const GAMES: &[GameCompat] = &[ ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("assetto"), - setup: "Plain force feedback; no shim; turn Steam Input off. For \ -simulated TrueForce, launch options `logi-launch %command%` (it puts the \ -telemetry relay in the game's prefix and starts the daemon for you); \ -nothing to switch on in the game.", + setup: "Plain force feedback. No shim. Turn Steam Input off. For simulated TrueForce, set the launch options to `logi-launch %command%`. logi-launch puts the telemetry relay in the game's prefix. It also starts the daemon for you. There is nothing to switch on in the game.", // Documented: the decoder reads only the head of Kunos' physics // block, which has not moved since AC 1.0, and checks the static // block's layout in-band before trusting the redline. Those exact @@ -696,7 +686,7 @@ nothing to switch on in the game.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("ams2-pcars2"), - setup: "Enable UDP telemetry (Project CARS 2 format) to 127.0.0.1; launch options `logi-launch %command%` (it starts logi-tf-sim for you); Steam Input off.", + setup: "Enable UDP telemetry. Use the Project CARS 2 format. Send it to 127.0.0.1. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you. Turn Steam Input off.", confidence: Confidence::Documented, }, GameCompat { @@ -705,7 +695,7 @@ nothing to switch on in the game.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("ams2-pcars2"), - setup: "Enable UDP telemetry (Project CARS 2 format); launch options `logi-launch %command%` (it starts logi-tf-sim for you).", + setup: "Enable UDP telemetry. Use the Project CARS 2 format. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you.", confidence: Confidence::Documented, }, GameCompat { @@ -714,7 +704,7 @@ nothing to switch on in the game.", ffb: Ffb::DirectInput, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("rf2"), - setup: "Launch options `logi-launch %command%` (it keeps raw HID off, runs the logi-ffb helper and puts the telemetry relay in the game's prefix for you); Steam Input off. Simulated TrueForce also needs the community rF2SharedMemoryMapPlugin installed in the game.", + setup: "Set the launch options to `logi-launch %command%`. logi-launch keeps raw HID off. It runs the logi-ffb helper. It puts the telemetry relay in the game's prefix for you. Turn Steam Input off. Simulated TrueForce also needs the community rF2SharedMemoryMapPlugin. Install that plugin in the game.", confidence: Confidence::Documented, }, GameCompat { @@ -723,7 +713,7 @@ nothing to switch on in the game.", ffb: Ffb::DirectInput, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("lmu"), - setup: "Launch options `logi-launch %command%` (it keeps raw HID off, runs the logi-ffb helper and puts the telemetry relay in the game's prefix for you); Steam Input off. Simulated TrueForce also needs the community rF2SharedMemoryMapPlugin installed in the game.", + setup: "Set the launch options to `logi-launch %command%`. logi-launch keeps raw HID off. It runs the logi-ffb helper. It puts the telemetry relay in the game's prefix for you. Turn Steam Input off. Simulated TrueForce also needs the community rF2SharedMemoryMapPlugin. Install that plugin in the game.", confidence: Confidence::Verified, }, GameCompat { @@ -738,7 +728,7 @@ nothing to switch on in the game.", // therefore stays DirectInput on purpose. native_trueforce: Support::Expected, simulated_tf: SimTf::LiveNow("iracing"), - setup: "Now Linux-playable; launch options `logi-launch %command%` (it keeps raw HID off, runs the logi-ffb helper and puts the telemetry relay in the game's prefix for you); Steam Input off.", + setup: "This game is now playable on Linux. Set the launch options to `logi-launch %command%`. logi-launch keeps raw HID off. It runs the logi-ffb helper. It puts the telemetry relay in the game's prefix for you. Turn Steam Input off.", // Expected: the decoder reads iRacing's own self-describing variable // table rather than guessed offsets, and is tested against the // documented layout, but nobody has yet confirmed the game even @@ -752,7 +742,7 @@ nothing to switch on in the game.", ffb: Ffb::DirectInput, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("raceroom"), - setup: "Launch options `logi-launch %command%` (it keeps raw HID off, runs the logi-ffb helper and puts the telemetry relay in the game's prefix for you); Steam Input off. Nothing to switch on in the game.", + setup: "Set the launch options to `logi-launch %command%`. logi-launch keeps raw HID off. It runs the logi-ffb helper. It puts the telemetry relay in the game's prefix for you. Turn Steam Input off. There is nothing to switch on in the game.", // Verified 2026-09-12 on an RS50 under Proton (#92): the relay read // `$R3E`, the daemon streamed engine texture from it and drove the // rev lights, and DirectInput force reached the wheel through @@ -770,9 +760,7 @@ nothing to switch on in the game.", ffb: Ffb::NativeEvdev, native_trueforce: Support::Expected, simulated_tf: SimTf::LiveNow("beamng"), - setup: "Plain force feedback on the native Linux build (Proton also \ -works); for simulated TrueForce, enable OutGauge to 127.0.0.1:4444 and run \ -logi-tf-sim.", + setup: "Plain force feedback on the native Linux build. Proton also works. For simulated TrueForce, enable OutGauge. Send it to 127.0.0.1:4444. Then run logi-tf-sim.", confidence: Confidence::Expected, }, GameCompat { @@ -781,7 +769,7 @@ logi-tf-sim.", ffb: Ffb::NativeEvdev, native_trueforce: Support::Expected, simulated_tf: SimTf::LiveNow("dirt-rally-2"), - setup: "Switch on the game's UDP telemetry, which is off by default: in `hardware_settings_config.xml` (under the game's documents folder in the prefix) set `` (the daemon needs the `extradata=\"3\"` packet; the default 0 is too short to synthesise from), port 20777 as it ships; launch options `logi-launch %command%` (it starts logi-tf-sim for you); Steam Input off. Force feedback under Proton reaches this game only through Wine's joystick path, which on some builds does not present the wheel at all; where it does not, the `logi-ffb` proxy route works, confirmed on a G PRO: add `690790 ffb=proxy` to `~/.config/logi-wheel/games.conf`, and because the game keys force feedback on the wheel's USB id, add `` to `input/devices/device_defines.xml` in the game folder: that is the virtual wheel's id on every wheel, not your wheel's own (#105, #125).", + setup: "Switch on the game's UDP telemetry. It is off by default. Open `hardware_settings_config.xml`. It is under the game's documents folder in the prefix. In that file, set ``. The daemon needs the `extradata=\"3\"` packet. The default 0 is too short to synthesise from. Keep port 20777 as it ships. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you. Turn Steam Input off. Under Proton, force feedback reaches this game only through Wine's joystick path. On some builds, that path does not present the wheel at all. Where it does not, the `logi-ffb` proxy route works. It is confirmed on a G PRO. Add `690790 ffb=proxy` to `~/.config/logi-wheel/games.conf`. The game keys force feedback on the wheel's USB id. So also add `` to `input/devices/device_defines.xml` in the game folder. That id is the virtual wheel's id on every wheel. It is not your wheel's own id. See #105 and #125.", confidence: Confidence::Documented, }, GameCompat { @@ -790,7 +778,7 @@ logi-tf-sim.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("codemasters"), - setup: "Enable UDP telemetry (Codemasters format); launch options `logi-launch %command%` (it starts logi-tf-sim for you).", + setup: "Enable UDP telemetry. Use the Codemasters format. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you.", confidence: Confidence::Documented, }, GameCompat { @@ -799,7 +787,7 @@ logi-tf-sim.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("ea-wrc"), - setup: "Add the logi-tf-sim WRC packet to config.json (UDP to 127.0.0.1:20777); launch options `logi-launch %command%` (it starts logi-tf-sim for you).", + setup: "Add the logi-tf-sim WRC packet to config.json. Send it over UDP to 127.0.0.1:20777. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you.", confidence: Confidence::Documented, }, GameCompat { @@ -808,7 +796,7 @@ logi-tf-sim.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("f1"), - setup: "Enable in-game UDP telemetry (F1 format, port 20777); launch options `logi-launch %command%` (it starts logi-tf-sim for you).", + setup: "Enable UDP telemetry in the game. Use the F1 format and port 20777. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you.", confidence: Confidence::Expected, }, GameCompat { @@ -817,7 +805,7 @@ logi-tf-sim.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::PossibleWithParser, - setup: "Plain force feedback; a telemetry plugin can feed logi-tf-sim.", + setup: "Plain force feedback. A telemetry plugin can feed logi-tf-sim.", confidence: Confidence::Expected, }, GameCompat { @@ -826,7 +814,7 @@ logi-tf-sim.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::No, - setup: "Plain force feedback; turn Steam Input off.", + setup: "Plain force feedback. Turn Steam Input off.", confidence: Confidence::Documented, }, GameCompat { @@ -842,7 +830,7 @@ logi-tf-sim.", ffb: Ffb::TrueForceShim, native_trueforce: Support::Yes, simulated_tf: SimTf::No, - setup: "Install the TrueForce shim once, from the app's Setup page; launch options `logi-launch %command%` (it turns raw HID on, stages the proxy that answers the SDK's rotation question, and resets the wheel first, the same recipe as Assetto Corsa EVO); turn Steam Input off. No telemetry yet, so nothing to feed the lights. On a G PRO a USB capture showed Logitech's library loading and then sending the wheel nothing at all: the route is in place, the game does not drive it (#105).", + setup: "Install the TrueForce shim once, from the app's Setup page. Set the launch options to `logi-launch %command%`. logi-launch turns raw HID on. It stages the proxy that answers the SDK's rotation question. It resets the wheel first. This is the same recipe as Assetto Corsa EVO. Turn Steam Input off. The game has no telemetry yet, so nothing feeds the lights. On a G PRO, a USB capture showed Logitech's library loading. It then sent the wheel nothing at all. The route is in place, but the game does not drive it. See #105.", // Confirmed on a G923 Xbox edition (#83). On a G PRO the route // stages correctly and the game's SDK streams nothing (#105, USB // capture), so Expected rather than Verified stands. @@ -854,8 +842,7 @@ logi-tf-sim.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("ets2"), - setup: "Plain force feedback on the native Linux build; no shim. For \ -simulated TrueForce, install the logi-tf-scs plugin (see docs/SCS_PLUGIN.md).", + setup: "Plain force feedback on the native Linux build. No shim. For simulated TrueForce, install the logi-tf-scs plugin. See docs/SCS_PLUGIN.md.", // Expected, not Verified: the plugin is built against the official // SDK headers with its struct layouts pinned by tests, but nobody // has yet loaded it into a running game and felt the result. @@ -867,8 +854,7 @@ simulated TrueForce, install the logi-tf-scs plugin (see docs/SCS_PLUGIN.md).", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("ats"), - setup: "Plain force feedback on the native Linux build; no shim. For \ -simulated TrueForce, install the logi-tf-scs plugin (see docs/SCS_PLUGIN.md).", + setup: "Plain force feedback on the native Linux build. No shim. For simulated TrueForce, install the logi-tf-scs plugin. See docs/SCS_PLUGIN.md.", // See the Euro Truck Simulator 2 entry: same plugin, same caveat. confidence: Confidence::Expected, }, @@ -878,7 +864,7 @@ simulated TrueForce, install the logi-tf-scs plugin (see docs/SCS_PLUGIN.md).", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::PossibleWithParser, - setup: "Plain force feedback; a telemetry parser could be added later.", + setup: "Plain force feedback. A telemetry parser could be added later.", confidence: Confidence::Unknown, }, GameCompat { @@ -887,7 +873,7 @@ simulated TrueForce, install the logi-tf-scs plugin (see docs/SCS_PLUGIN.md).", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::No, - setup: "Plain force feedback; turn Steam Input off.", + setup: "Plain force feedback. Turn Steam Input off.", confidence: Confidence::Documented, }, GameCompat { @@ -896,10 +882,7 @@ simulated TrueForce, install the logi-tf-scs plugin (see docs/SCS_PLUGIN.md).", ffb: Ffb::NativeEvdev, native_trueforce: Support::Expected, simulated_tf: SimTf::LiveNow("codemasters"), - setup: "Enable UDP telemetry (Codemasters format); launch options \ -`logi-launch %command%` (it starts logi-tf-sim for you); Steam Input off. \ -Whether its TrueForce reaches the wheel through Logitech's SDK is \ -unconfirmed, so nothing here installs one; reports welcome.", + setup: "Enable UDP telemetry. Use the Codemasters format. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you. Turn Steam Input off. It is not confirmed that this game's TrueForce reaches the wheel through Logitech's SDK. So nothing here installs the SDK. Reports are welcome.", confidence: Confidence::Documented, }, GameCompat { @@ -908,9 +891,7 @@ unconfirmed, so nothing here installs one; reports welcome.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::LiveNow("codemasters"), - setup: "Enable UDP telemetry (Codemasters format); launch options \ -`logi-launch %command%` (it starts logi-tf-sim for you); turn Steam Input \ -off.", + setup: "Enable UDP telemetry. Use the Codemasters format. Set the launch options to `logi-launch %command%`. logi-launch starts logi-tf-sim for you. Turn Steam Input off.", confidence: Confidence::Documented, }, GameCompat { @@ -919,7 +900,7 @@ off.", ffb: Ffb::TrueForceShim, native_trueforce: Support::Yes, simulated_tf: SimTf::No, - setup: "Not on Linux (anti-cheat / storefront); TrueForce here is a Windows-only story.", + setup: "Not on Linux, because of the anti-cheat and the storefront. TrueForce in this game is Windows-only.", confidence: Confidence::Documented, }, GameCompat { @@ -942,7 +923,7 @@ off.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::No, - setup: "PlayStation 5 only; not a Linux target.", + setup: "PlayStation 5 only. Not a Linux target.", confidence: Confidence::Documented, }, GameCompat { @@ -960,7 +941,7 @@ off.", ffb: Ffb::NativeEvdev, native_trueforce: Support::No, simulated_tf: SimTf::No, - setup: "Anti-cheat may block some builds; verify per release.", + setup: "Anti-cheat may block some builds. Verify this for each release.", confidence: Confidence::Unknown, }, GameCompat { diff --git a/userspace/logi-wheel/crates/logi-wheel-core/src/lib.rs b/userspace/logi-wheel/crates/logi-wheel-core/src/lib.rs index 4aa3312..ae5c6a9 100644 --- a/userspace/logi-wheel/crates/logi-wheel-core/src/lib.rs +++ b/userspace/logi-wheel/crates/logi-wheel-core/src/lib.rs @@ -31,7 +31,7 @@ pub mod launch; pub mod launchers; pub mod onboard; pub mod profiles; -pub mod shaping; +pub mod response_view; pub mod steam; pub mod tfsim; pub mod device; diff --git a/userspace/logi-wheel/crates/logi-wheel-core/src/registry.rs b/userspace/logi-wheel/crates/logi-wheel-core/src/registry.rs index b61d01d..19e0d83 100644 --- a/userspace/logi-wheel/crates/logi-wheel-core/src/registry.rs +++ b/userspace/logi-wheel/crates/logi-wheel-core/src/registry.rs @@ -50,11 +50,11 @@ pub const REGISTRY: &[SettingSpec] = &[ // lives here rather than with the RS50 LIGHTSYNC strip. SettingSpec { attr: "wheel_range", label: "Rotation range", help: "How far the wheel turns lock to lock. Match it to the car: rally around 540, F1 around 360, drift wider (90-2700 degrees).", category: Steering, kind: Kind::IntRange { min: 90, max: 2700, step: 10, unit: "deg" }, access: ReadWrite, mode_req: Any }, SettingSpec { attr: "wheel_range_restore", label: "Auto range restore", help: "Automatically puts your rotation range back if a game or launch resets it to 90 degrees. Leave on unless it fights a game you trust.", category: Steering, kind: Kind::Toggle { off: "off", on: "on" }, access: ReadWrite, mode_req: Any }, - SettingSpec { attr: "wheel_sensitivity", label: "Sensitivity", help: "Reshapes how far you turn the wheel for a given in-game steering angle. Below 50 is calmer near centre, above 50 quicker; 50 is the built-in feel. Works in desktop mode only.", category: Steering, kind: PCT, access: ReadWrite, mode_req: DesktopOnly }, + SettingSpec { attr: "wheel_sensitivity", label: "Sensitivity", help: "Changes how far you turn the wheel for a given in-game steering angle. Below 50 is calmer near centre, above 50 quicker; 50 is the built-in feel. Works in desktop mode only.", category: Steering, kind: PCT, access: ReadWrite, mode_req: DesktopOnly }, // Any, not DesktopOnly: unlike wheel_sensitivity, the driver's // wheel_response_curve_store does not gate on mode (no -EPERM), so a // DesktopOnly pre-check would falsely reject onboard-mode writes. - SettingSpec { attr: "wheel_response_curve", label: "Response curve", help: "Shapes the whole steering response by hand, so you can soften or sharpen the feel at any point of the turn. Use 'reset' to go back to the built-in feel.", category: Steering, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_response_curve", label: "Response curve", help: "Sets the whole steering response by hand, so you can soften or sharpen the feel at any point of the turn. Use 'reset' to go back to the built-in feel.", category: Steering, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, SettingSpec { attr: "wheel_calibrate_here", label: "Calibrate centre here", help: "Sets the wheel's current physical position as dead centre. Hold the wheel straight, then run this if the centre point has drifted.", category: Steering, kind: Kind::Action, access: Action, mode_req: Any }, // Read-only in this app for the reason `wheel_texture_rpm` above is: the // strip is a live feed, driven by logi-rpm-bridge during a texture-merge @@ -78,14 +78,14 @@ pub const REGISTRY: &[SettingSpec] = &[ // generator is visible. The handbrake accessory comes last. SettingSpec { attr: "wheel_combined_pedals", label: "Combined pedals", help: "Merges throttle and brake onto one axis for older games that expect a single pedal input. Leave off for modern sims. Works in desktop mode only.", category: Pedals, kind: Kind::Toggle { off: "separate", on: "combined" }, access: ReadWrite, mode_req: DesktopOnly }, SettingSpec { attr: "wheel_brake_force", label: "Brake force", help: "How hard you must press the load-cell brake for full braking (0-100%). Stored on the wheel in onboard mode only; in desktop mode use Brake sensitivity or the brake curve.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: OnboardOnly }, - SettingSpec { attr: "wheel_throttle_sensitivity", label: "Throttle sensitivity", help: "Reshapes how pedal travel maps to throttle. Below 50 eases in for finer control off idle, above 50 responds faster; 50 is straight linear.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, - SettingSpec { attr: "wheel_throttle_curve", label: "Throttle curve", help: "Shapes the whole throttle response by hand for precise control over how power comes in through the pedal travel. Use 'reset' for the straight built-in response.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_throttle_sensitivity", label: "Throttle sensitivity", help: "Changes how pedal travel maps to throttle. Below 50 eases in for finer control off idle, above 50 responds faster; 50 is straight linear.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_throttle_curve", label: "Throttle curve", help: "Sets the whole throttle response by hand for precise control over how power comes in through the pedal travel. Use 'reset' for the straight built-in response.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, SettingSpec { attr: "wheel_throttle_deadzone", label: "Throttle deadzone", help: "Ignores a slice of travel at the top and bottom of the throttle so light presses and the pinned position register cleanly. Enter lower and upper percent (they must sum to 99 or less).", category: Pedals, kind: Kind::Pair { max: 99 }, access: ReadWrite, mode_req: Any }, - SettingSpec { attr: "wheel_brake_sensitivity", label: "Brake sensitivity", help: "Reshapes how pedal travel maps to braking. Below 50 eases in for finer trail-braking, above 50 bites harder early; 50 is straight linear.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, - SettingSpec { attr: "wheel_brake_curve", label: "Brake curve", help: "Shapes the whole brake response by hand so you can fine-tune bite point and modulation across the pedal travel. Use 'reset' for the straight built-in response.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_brake_sensitivity", label: "Brake sensitivity", help: "Changes how pedal travel maps to braking. Below 50 eases in for finer trail-braking, above 50 bites harder early; 50 is straight linear.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_brake_curve", label: "Brake curve", help: "Sets the whole brake response by hand so you can fine-tune bite point and modulation across the pedal travel. Use 'reset' for the straight built-in response.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, SettingSpec { attr: "wheel_brake_deadzone", label: "Brake deadzone", help: "Ignores a slice of travel at the top and bottom of the brake so a resting foot and full braking register cleanly. Enter lower and upper percent (they must sum to 99 or less).", category: Pedals, kind: Kind::Pair { max: 99 }, access: ReadWrite, mode_req: Any }, - SettingSpec { attr: "wheel_clutch_sensitivity", label: "Clutch sensitivity", help: "Reshapes how pedal travel maps to the clutch. Below 50 eases in for smoother bite-point control, above 50 engages faster; 50 is straight linear.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, - SettingSpec { attr: "wheel_clutch_curve", label: "Clutch curve", help: "Shapes the whole clutch response by hand so you can dial in the bite point for clean launches. Use 'reset' for the straight built-in response.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_clutch_sensitivity", label: "Clutch sensitivity", help: "Changes how pedal travel maps to the clutch. Below 50 eases in for smoother bite-point control, above 50 engages faster; 50 is straight linear.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_clutch_curve", label: "Clutch curve", help: "Sets the whole clutch response by hand so you can dial in the bite point for clean launches. Use 'reset' for the straight built-in response.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, SettingSpec { attr: "wheel_clutch_deadzone", label: "Clutch deadzone", help: "Ignores a slice of travel at the top and bottom of the clutch so a resting foot and full engagement register cleanly. Enter lower and upper percent (they must sum to 99 or less).", category: Pedals, kind: Kind::Pair { max: 99 }, access: ReadWrite, mode_req: Any }, // RS Shifter & Handbrake accessory (analog handbrake axis shaping). Same // 0x80A4 curve type as the pedals, but applied on the wheel base, not on @@ -95,8 +95,8 @@ pub const REGISTRY: &[SettingSpec] = &[ // `wheel_accessory` instead, which is what makes the rows read unavailable // when no handbrake is connected. SettingSpec { attr: "wheel_accessory_mode", label: "Accessory mode", help: "Which of its three jobs the RS Shifter & Handbrake is doing right now, set by the physical switch on its base: sequential shifter, digital handbrake, or analog handbrake. Settings that belong to a different mode are shown greyed out.", category: Pedals, kind: Kind::TextField { max_len: 24 }, access: ReadOnly, mode_req: Any }, - SettingSpec { attr: "wheel_handbrake_sensitivity", label: "Handbrake sensitivity", help: "Reshapes how the analog handbrake's pull maps in game. Below 50 eases in for gentler slides, above 50 grabs sooner; 50 is straight linear. Needs the handbrake accessory connected.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, - SettingSpec { attr: "wheel_handbrake_curve", label: "Handbrake curve", help: "Shapes the whole handbrake response by hand for precise slide control across its travel. Use 'reset' for the straight built-in response. Needs the handbrake accessory connected.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_handbrake_sensitivity", label: "Handbrake sensitivity", help: "Changes how the analog handbrake's pull maps in game. Below 50 eases in for gentler slides, above 50 grabs sooner; 50 is straight linear. Needs the handbrake accessory connected.", category: Pedals, kind: PCT, access: ReadWrite, mode_req: Any }, + SettingSpec { attr: "wheel_handbrake_curve", label: "Handbrake curve", help: "Sets the whole handbrake response by hand for precise slide control across its travel. Use 'reset' for the straight built-in response. Needs the handbrake accessory connected.", category: Pedals, kind: Kind::Curve, access: ReadWrite, mode_req: Any }, // The accessory's own actuation points (0x80B1), after the handbrake // shaping pair so that pair stays adjacent for the shaping toggle. // These are trigger POINTS, not response shaping, so they are not diff --git a/userspace/logi-wheel/crates/logi-wheel-core/src/shaping.rs b/userspace/logi-wheel/crates/logi-wheel-core/src/response_view.rs similarity index 90% rename from userspace/logi-wheel/crates/logi-wheel-core/src/shaping.rs rename to userspace/logi-wheel/crates/logi-wheel-core/src/response_view.rs index cffc374..61bba8f 100644 --- a/userspace/logi-wheel/crates/logi-wheel-core/src/shaping.rs +++ b/userspace/logi-wheel/crates/logi-wheel-core/src/response_view.rs @@ -16,7 +16,7 @@ /// How a settings row relates to an axis's shaping view toggle. #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ShapingRole { +pub enum ResponseRole { /// A sensitivity percentage: shown while the axis's toggle is off. Simple, /// A full response-curve editor: shown while the axis's toggle is on. @@ -71,19 +71,19 @@ pub fn axis(attr: &str) -> Option { } /// Classify `attr` for the per-axis shaping toggles. -pub fn role(attr: &str) -> ShapingRole { +pub fn role(attr: &str) -> ResponseRole { match attr { "wheel_sensitivity" | "wheel_throttle_sensitivity" | "wheel_brake_sensitivity" | "wheel_clutch_sensitivity" - | "wheel_handbrake_sensitivity" => ShapingRole::Simple, + | "wheel_handbrake_sensitivity" => ResponseRole::Simple, "wheel_response_curve" | "wheel_throttle_curve" | "wheel_brake_curve" | "wheel_clutch_curve" - | "wheel_handbrake_curve" => ShapingRole::Advanced, - _ => ShapingRole::Neutral, + | "wheel_handbrake_curve" => ResponseRole::Advanced, + _ => ResponseRole::Neutral, } } @@ -92,11 +92,11 @@ pub fn role(attr: &str) -> ShapingRole { /// own edit path and flip local view state instead. pub fn toggle_attr(axis: Axis) -> &'static str { match axis { - Axis::Steering => "ui:shaping:steering", - Axis::Throttle => "ui:shaping:throttle", - Axis::Brake => "ui:shaping:brake", - Axis::Clutch => "ui:shaping:clutch", - Axis::Handbrake => "ui:shaping:handbrake", + Axis::Steering => "ui:response:steering", + Axis::Throttle => "ui:response:throttle", + Axis::Brake => "ui:response:brake", + Axis::Clutch => "ui:response:clutch", + Axis::Handbrake => "ui:response:handbrake", } } @@ -109,11 +109,11 @@ pub fn toggle_axis(attr: &str) -> Option { /// The per-axis toggle rows' labels, shared by both front-ends. pub fn toggle_label(axis: Axis) -> &'static str { match axis { - Axis::Steering => "Steering shaping", - Axis::Throttle => "Throttle shaping", - Axis::Brake => "Brake shaping", - Axis::Clutch => "Clutch shaping", - Axis::Handbrake => "Handbrake shaping", + Axis::Steering => "Steering response", + Axis::Throttle => "Throttle response", + Axis::Brake => "Brake response", + Axis::Clutch => "Clutch response", + Axis::Handbrake => "Handbrake response", } } @@ -153,9 +153,9 @@ impl AxisToggles { pub fn visible(attr: &str, toggles: AxisToggles) -> bool { let curve = axis(attr).is_some_and(|ax| toggles.get(ax)); match role(attr) { - ShapingRole::Simple => !curve, - ShapingRole::Advanced => curve, - ShapingRole::Neutral => true, + ResponseRole::Simple => !curve, + ResponseRole::Advanced => curve, + ResponseRole::Neutral => true, } } @@ -183,14 +183,14 @@ mod tests { #[test] fn every_sensitivity_attr_is_simple() { for attr in SENSITIVITIES { - assert_eq!(role(attr), ShapingRole::Simple, "{attr}"); + assert_eq!(role(attr), ResponseRole::Simple, "{attr}"); } } #[test] fn every_curve_attr_is_advanced() { for attr in CURVES { - assert_eq!(role(attr), ShapingRole::Advanced, "{attr}"); + assert_eq!(role(attr), ResponseRole::Advanced, "{attr}"); } } @@ -206,7 +206,7 @@ mod tests { toggle_attr(Axis::Throttle), "not_a_real_attr", ] { - assert_eq!(role(attr), ShapingRole::Neutral, "{attr}"); + assert_eq!(role(attr), ResponseRole::Neutral, "{attr}"); } } @@ -257,7 +257,7 @@ mod tests { assert!(matches!(spec.kind, Kind::Curve), "{attr} is not a curve"); } for spec in REGISTRY.iter().filter(|s| matches!(s.kind, Kind::Curve)) { - assert_eq!(role(spec.attr), ShapingRole::Advanced, "{} is a curve but not Advanced", spec.attr); + assert_eq!(role(spec.attr), ResponseRole::Advanced, "{} is a curve but not Advanced", spec.attr); } } @@ -267,7 +267,7 @@ mod tests { assert_eq!(toggle_axis(toggle_attr(ax)), Some(ax)); } assert_eq!(toggle_axis("wheel_sensitivity"), None); - assert_eq!(toggle_axis("ui:shaping:nope"), None); + assert_eq!(toggle_axis("ui:response:nope"), None); } #[test] diff --git a/userspace/logi-wheel/crates/logi-wheel-gui/src/bridge.rs b/userspace/logi-wheel/crates/logi-wheel-gui/src/bridge.rs index a0d602b..e948153 100644 --- a/userspace/logi-wheel/crates/logi-wheel-gui/src/bridge.rs +++ b/userspace/logi-wheel/crates/logi-wheel-gui/src/bridge.rs @@ -6,7 +6,7 @@ //! is the only place that knows about both worlds. use logi_wheel_core::curve::{Curve, FULL}; -use logi_wheel_core::shaping::{self, ShapingRole}; +use logi_wheel_core::response_view::{self, ResponseRole}; use logi_wheel_core::{lightsync, oled, Access, Category, Color, Error, Kind, Value, WheelModel, REGISTRY}; use logi_wheel_core::games::{self, SetupAction}; @@ -62,10 +62,10 @@ pub const KIND_LIGHT_SLOT: i32 = 13; /// The "Edit screen..." button row: opens the OLED editor overlay /// (`oled_editor.slint`). Synthetic, like the slot editor's row. pub const KIND_OLED_EDIT: i32 = 15; -/// A per-axis shaping toggle row `compose_shaping` inserts: a Switch whose +/// A per-axis shaping toggle row `compose_response_view` inserts: a Switch whose /// own label reads "Sensitivity" (off) or "Curve" (on). Never produced by /// `kind_tag`; the row does not exist in the registry (its attr is -/// `shaping::toggle_attr`'s reserved `ui:` name, intercepted in `main.rs`). +/// `response_view::toggle_attr`'s reserved `ui:` name, intercepted in `main.rs`). pub const KIND_SHAPING: i32 = 14; /// The synthetic "Edit slot" row's attr. Not a sysfs attribute: it only @@ -135,7 +135,7 @@ fn is_read_only(attr: &str) -> bool { /// (the per-axis shaping toggle, the LIGHTSYNC "Edit slot" button) are /// grouped with their block. An unknown attr returns "" (no card header). pub fn attr_group(attr: &str) -> &'static str { - if let Some(ax) = shaping::toggle_axis(attr) { + if let Some(ax) = response_view::toggle_axis(attr) { return axis_group(ax); } if attr == LIGHT_EDIT_SLOT_ATTR { @@ -185,13 +185,13 @@ pub fn attr_group(attr: &str) -> &'static str { /// The group title of one shaping axis's block (its sensitivity/curve/ /// deadzone rows and the injected toggle). Steering's shaping lives under /// the steering "Response" card; each pedal has its own card. -fn axis_group(ax: shaping::Axis) -> &'static str { +fn axis_group(ax: response_view::Axis) -> &'static str { match ax { - shaping::Axis::Steering => "RESPONSE", - shaping::Axis::Throttle => "THROTTLE", - shaping::Axis::Brake => "BRAKE", - shaping::Axis::Clutch => "CLUTCH", - shaping::Axis::Handbrake => "HANDBRAKE", + response_view::Axis::Steering => "RESPONSE", + response_view::Axis::Throttle => "THROTTLE", + response_view::Axis::Brake => "BRAKE", + response_view::Axis::Clutch => "CLUTCH", + response_view::Axis::Handbrake => "HANDBRAKE", } } @@ -609,17 +609,17 @@ pub fn oled_preview_model(layout: &oled::Layout, values: &[String]) -> slint::Mo slint::ModelRc::new(slint::VecModel::from(rows)) } -/// Build one synthetic per-axis shaping toggle row `compose_shaping` +/// Build one synthetic per-axis shaping toggle row `compose_response_view` /// inserts. A `KIND_SHAPING` Switch wearing that axis's reserved -/// `shaping::toggle_attr` attr: it commits through the same `edit-switch` +/// `response_view::toggle_attr` attr: it commits through the same `edit-switch` /// callback every real toggle uses, and `main.rs` intercepts those attrs /// there to flip its local view state instead of sending a worker request /// (the toggles are pure view state, never a device write). -fn shaping_toggle_row(axis: shaping::Axis, curve: bool) -> SettingRow { +fn shaping_toggle_row(axis: response_view::Axis, curve: bool) -> SettingRow { SettingRow { - attr: shaping::toggle_attr(axis).into(), - label: shaping::toggle_label(axis).into(), - help: shaping::TOGGLE_HELP.into(), + attr: response_view::toggle_attr(axis).into(), + label: response_view::toggle_label(axis).into(), + help: response_view::TOGGLE_HELP.into(), kind: KIND_SHAPING, int_value: 0, int_value2: 0, @@ -641,16 +641,16 @@ fn shaping_toggle_row(axis: shaping::Axis, curve: bool) -> SettingRow { } /// Compose a category's rows for the per-axis shaping toggles: when any row -/// is a shaping generator (a sensitivity or a curve; see `shaping::role`), +/// is a shaping generator (a sensitivity or a curve; see `response_view::role`), /// insert each axis's toggle row right before that axis's first row (its -/// block heading) and keep only the rows `shaping::visible` allows for the +/// block heading) and keep only the rows `response_view::visible` allows for the /// current toggles (an axis on "Sensitivity" hides its curve, an axis on /// "Curve" hides its sensitivity, deadzones and everything else stay). Rows /// for a category with no shaping generators pass through untouched, so /// `load_rows` can call this unconditionally, same convention as /// `compose_lightsync`. -pub fn compose_shaping(items: Vec, toggles: shaping::AxisToggles) -> Vec { - if !items.iter().any(|r| shaping::role(r.attr.as_str()) != ShapingRole::Neutral) { +pub fn compose_response_view(items: Vec, toggles: response_view::AxisToggles) -> Vec { + if !items.iter().any(|r| response_view::role(r.attr.as_str()) != ResponseRole::Neutral) { return items; } // An axis with no available generator row has nothing for its toggle to @@ -658,22 +658,22 @@ pub fn compose_shaping(items: Vec, toggles: shaping::AxisToggles) -> // attached), so it gets no toggle at all rather than one that offers a // choice which cannot change anything. Keyed on availability, not on the // handbrake specifically, so any future axis behaves the same way. Mirrors - // the TUI's `shaping_rows`. - let live: Vec = shaping::Axis::ALL + // the TUI's `response_view_rows`. + let live: Vec = response_view::Axis::ALL .iter() .copied() - .filter(|ax| items.iter().any(|r| shaping::axis(r.attr.as_str()) == Some(*ax) && r.available)) + .filter(|ax| items.iter().any(|r| response_view::axis(r.attr.as_str()) == Some(*ax) && r.available)) .collect(); - let mut out = Vec::with_capacity(items.len() + shaping::Axis::ALL.len()); - let mut headed: Vec = Vec::new(); + let mut out = Vec::with_capacity(items.len() + response_view::Axis::ALL.len()); + let mut headed: Vec = Vec::new(); for item in items { - if let Some(ax) = shaping::axis(item.attr.as_str()) { + if let Some(ax) = response_view::axis(item.attr.as_str()) { if !headed.contains(&ax) && live.contains(&ax) { headed.push(ax); out.push(shaping_toggle_row(ax, toggles.get(ax))); } } - if shaping::visible(item.attr.as_str(), toggles) { + if response_view::visible(item.attr.as_str(), toggles) { out.push(item); } } @@ -2576,7 +2576,7 @@ mod tests { let fs = FakeSysfs::new(); fs.set("wheel_mode", "desktop"); // Give every shapeable axis one available generator, so this stands for - // a wheel that actually has these axes. `compose_shaping` heads an axis + // a wheel that actually has these axes. `compose_response_view` heads an axis // block only when the axis has something available to toggle between, // and a fixture with no attributes at all is a wheel with no axes. for attr in [ @@ -2600,7 +2600,7 @@ mod tests { rows.iter().map(|r| r.attr.to_string()).collect() } - use logi_wheel_core::shaping::{Axis, AxisToggles}; + use logi_wheel_core::response_view::{Axis, AxisToggles}; fn all_curves() -> AxisToggles { let mut t = AxisToggles::default(); @@ -2611,15 +2611,15 @@ mod tests { } #[test] - fn compose_shaping_simple_steering_shows_sensitivity_not_the_curve() { - let out = compose_shaping(category_setting_rows(Category::Steering), AxisToggles::default()); + fn compose_response_view_simple_steering_shows_sensitivity_not_the_curve() { + let out = compose_response_view(category_setting_rows(Category::Steering), AxisToggles::default()); let attrs = attrs_of(&out); assert_eq!( attrs, vec![ "wheel_range", "wheel_range_restore", - shaping::toggle_attr(Axis::Steering), + response_view::toggle_attr(Axis::Steering), "wheel_sensitivity", "wheel_calibrate_here", "wheel_rev_level", @@ -2628,15 +2628,15 @@ mod tests { } #[test] - fn compose_shaping_curve_steering_shows_the_curve_not_sensitivity() { - let out = compose_shaping(category_setting_rows(Category::Steering), all_curves()); + fn compose_response_view_curve_steering_shows_the_curve_not_sensitivity() { + let out = compose_response_view(category_setting_rows(Category::Steering), all_curves()); let attrs = attrs_of(&out); assert_eq!( attrs, vec![ "wheel_range", "wheel_range_restore", - shaping::toggle_attr(Axis::Steering), + response_view::toggle_attr(Axis::Steering), "wheel_response_curve", "wheel_calibrate_here", "wheel_rev_level", @@ -2645,25 +2645,25 @@ mod tests { } #[test] - fn compose_shaping_simple_pedals_heads_each_block_and_hides_curves() { - let out = compose_shaping(category_setting_rows(Category::Pedals), AxisToggles::default()); + fn compose_response_view_simple_pedals_heads_each_block_and_hides_curves() { + let out = compose_response_view(category_setting_rows(Category::Pedals), AxisToggles::default()); let attrs = attrs_of(&out); assert_eq!( attrs, vec![ "wheel_combined_pedals", "wheel_brake_force", - shaping::toggle_attr(Axis::Throttle), + response_view::toggle_attr(Axis::Throttle), "wheel_throttle_sensitivity", "wheel_throttle_deadzone", - shaping::toggle_attr(Axis::Brake), + response_view::toggle_attr(Axis::Brake), "wheel_brake_sensitivity", "wheel_brake_deadzone", - shaping::toggle_attr(Axis::Clutch), + response_view::toggle_attr(Axis::Clutch), "wheel_clutch_sensitivity", "wheel_clutch_deadzone", "wheel_accessory_mode", - shaping::toggle_attr(Axis::Handbrake), + response_view::toggle_attr(Axis::Handbrake), "wheel_handbrake_sensitivity", "wheel_shift_actuation", "wheel_handbrake_actuation", @@ -2672,25 +2672,25 @@ mod tests { } #[test] - fn compose_shaping_curve_pedals_keep_the_deadzone_right_after_the_curve() { - let out = compose_shaping(category_setting_rows(Category::Pedals), all_curves()); + fn compose_response_view_curve_pedals_keep_the_deadzone_right_after_the_curve() { + let out = compose_response_view(category_setting_rows(Category::Pedals), all_curves()); let attrs = attrs_of(&out); assert_eq!( attrs, vec![ "wheel_combined_pedals", "wheel_brake_force", - shaping::toggle_attr(Axis::Throttle), + response_view::toggle_attr(Axis::Throttle), "wheel_throttle_curve", "wheel_throttle_deadzone", - shaping::toggle_attr(Axis::Brake), + response_view::toggle_attr(Axis::Brake), "wheel_brake_curve", "wheel_brake_deadzone", - shaping::toggle_attr(Axis::Clutch), + response_view::toggle_attr(Axis::Clutch), "wheel_clutch_curve", "wheel_clutch_deadzone", "wheel_accessory_mode", - shaping::toggle_attr(Axis::Handbrake), + response_view::toggle_attr(Axis::Handbrake), "wheel_handbrake_curve", "wheel_shift_actuation", "wheel_handbrake_actuation", @@ -2699,8 +2699,8 @@ mod tests { } #[test] - fn compose_shaping_curve_pedals_keeps_deadzones_and_hides_sensitivities() { - let out = compose_shaping(category_setting_rows(Category::Pedals), all_curves()); + fn compose_response_view_curve_pedals_keeps_deadzones_and_hides_sensitivities() { + let out = compose_response_view(category_setting_rows(Category::Pedals), all_curves()); let attrs = attrs_of(&out); for kept in [ "wheel_throttle_deadzone", @@ -2720,12 +2720,12 @@ mod tests { } #[test] - fn compose_shaping_mixes_axes_independently() { + fn compose_response_view_mixes_axes_independently() { // The user's own example: throttle on simple sensitivity, brake on // the curve editor, at the same time. let mut toggles = AxisToggles::default(); toggles.set(Axis::Brake, true); - let out = compose_shaping(category_setting_rows(Category::Pedals), toggles); + let out = compose_response_view(category_setting_rows(Category::Pedals), toggles); let attrs = attrs_of(&out); assert!(attrs.contains(&"wheel_throttle_sensitivity".to_string())); assert!(!attrs.contains(&"wheel_throttle_curve".to_string())); @@ -2734,31 +2734,31 @@ mod tests { // Both blocks keep their deadzones and their own toggle row. assert!(attrs.contains(&"wheel_throttle_deadzone".to_string())); assert!(attrs.contains(&"wheel_brake_deadzone".to_string())); - assert!(attrs.contains(&shaping::toggle_attr(Axis::Throttle).to_string())); - assert!(attrs.contains(&shaping::toggle_attr(Axis::Brake).to_string())); + assert!(attrs.contains(&response_view::toggle_attr(Axis::Throttle).to_string())); + assert!(attrs.contains(&response_view::toggle_attr(Axis::Brake).to_string())); } #[test] - fn compose_shaping_toggle_rows_carry_the_axis_flag_and_help() { + fn compose_response_view_toggle_rows_carry_the_axis_flag_and_help() { let mut toggles = AxisToggles::default(); toggles.set(Axis::Brake, true); - let out = compose_shaping(category_setting_rows(Category::Pedals), toggles); - let brake = out.iter().find(|r| r.attr == shaping::toggle_attr(Axis::Brake)).unwrap(); + let out = compose_response_view(category_setting_rows(Category::Pedals), toggles); + let brake = out.iter().find(|r| r.attr == response_view::toggle_attr(Axis::Brake)).unwrap(); assert_eq!(brake.kind, KIND_SHAPING); assert!(brake.bool_value, "brake toggle is on"); - assert_eq!(brake.label, shaping::toggle_label(Axis::Brake)); - assert_eq!(brake.help, shaping::TOGGLE_HELP); + assert_eq!(brake.label, response_view::toggle_label(Axis::Brake)); + assert_eq!(brake.help, response_view::TOGGLE_HELP); assert!(brake.available && brake.mode_ok); - let throttle = out.iter().find(|r| r.attr == shaping::toggle_attr(Axis::Throttle)).unwrap(); + let throttle = out.iter().find(|r| r.attr == response_view::toggle_attr(Axis::Throttle)).unwrap(); assert!(!throttle.bool_value, "throttle toggle is off"); } #[test] - fn compose_shaping_leaves_other_categories_untouched() { + fn compose_response_view_leaves_other_categories_untouched() { for cat in [Category::Ffb, Category::Leds, Category::Profiles, Category::Info] { let items = category_setting_rows(cat); let before = attrs_of(&items); - let after = attrs_of(&compose_shaping(items, all_curves())); + let after = attrs_of(&compose_response_view(items, all_curves())); assert_eq!(before, after, "{cat:?} must pass through"); } } @@ -2813,8 +2813,8 @@ mod tests { assert_eq!(attr_group("wheel_led_brightness"), "STRIP"); assert_eq!(attr_group(LIGHT_EDIT_SLOT_ATTR), "CUSTOM SLOT"); // The synthetic per-axis shaping toggle rows join their axis block. - assert_eq!(attr_group(shaping::toggle_attr(shaping::Axis::Steering)), "RESPONSE"); - assert_eq!(attr_group(shaping::toggle_attr(shaping::Axis::Brake)), "BRAKE"); + assert_eq!(attr_group(response_view::toggle_attr(response_view::Axis::Steering)), "RESPONSE"); + assert_eq!(attr_group(response_view::toggle_attr(response_view::Axis::Brake)), "BRAKE"); // Unknown attrs carry no card header. assert_eq!(attr_group("nope"), ""); } diff --git a/userspace/logi-wheel/crates/logi-wheel-gui/src/main.rs b/userspace/logi-wheel/crates/logi-wheel-gui/src/main.rs index 80eec4e..c51924a 100644 --- a/userspace/logi-wheel/crates/logi-wheel-gui/src/main.rs +++ b/userspace/logi-wheel/crates/logi-wheel-gui/src/main.rs @@ -16,7 +16,7 @@ use std::sync::{Arc, Mutex}; use logi_wheel_core::curve::Curve; use logi_wheel_core::evtest; use logi_wheel_core::fftest::{self, SequenceEnd, SequenceEvent}; -use logi_wheel_core::{lightsync, shaping}; +use logi_wheel_core::{lightsync, response_view}; use logi_wheel_core::{Category, Color, Mode, Value, WheelModel, REGISTRY}; use slint::Model as _; use viewmodel::WidgetInput; @@ -208,7 +208,7 @@ fn load_rows( rows: &[viewmodel::Row], profile_names: &[String], led_names: &[String], - shaping_toggles: shaping::AxisToggles, + response_toggles: response_view::AxisToggles, ) { let items = bridge::setting_rows(rows); // A no-op for every category but Profiles (see `compose_profiles`'s @@ -221,10 +221,10 @@ fn load_rows( // button instead of the registry's raw row-per-attr list. let items = bridge::compose_lightsync(items, led_names); // A no-op for every category without shaping generators (see - // `compose_shaping`'s doc): Steering and Pedals get a per-axis shaping + // `compose_response_view`'s doc): Steering and Pedals get a per-axis shaping // toggle row heading each axis block, and each axis shows either its // sensitivity row or its curve row, never both. - let items = bridge::compose_shaping(items, shaping_toggles); + let items = bridge::compose_response_view(items, response_toggles); // The page's ordered distinct card titles for this composed row set (see // `bridge::row_groups`); the settings list groups its rows by these. // Recomputed on every reload so a shaping toggle that changes which rows @@ -1435,9 +1435,9 @@ fn main() -> Result<(), slint::PlatformError> { Arc::new(Mutex::new(vec![String::new(); lightsync::CUSTOM_SLOTS])); // The per-axis shaping view toggles: pure per-session view state (never // persisted, never a sysfs write). Read when composing rows; flipped by - // the synthetic `shaping::toggle_attr` rows' Switches, which + // the synthetic `response_view::toggle_attr` rows' Switches, which // `edit-switch` intercepts below. - let shaping_toggles = Arc::new(Mutex::new(shaping::AxisToggles::default())); + let response_toggles = Arc::new(Mutex::new(response_view::AxisToggles::default())); // The current category's last full (unfiltered) row list, kept so the // shaping toggle can re-compose the page locally, without a worker // round trip: the visible model only holds the filtered rows, so @@ -1477,7 +1477,7 @@ fn main() -> Result<(), slint::PlatformError> { let known_values = known_values.clone(); let led_slot_names = led_slot_names.clone(); let slot_text_editor = slot_text_editor.clone(); - let shaping_toggles = shaping_toggles.clone(); + let response_toggles = response_toggles.clone(); let last_rows = last_rows.clone(); let visible_categories = visible_categories.clone(); let onboard_name_rev = onboard_name_rev.clone(); @@ -1494,7 +1494,7 @@ fn main() -> Result<(), slint::PlatformError> { let known_values = known_values.clone(); let led_slot_names = led_slot_names.clone(); let slot_text_editor = slot_text_editor.clone(); - let shaping_toggles = shaping_toggles.clone(); + let response_toggles = response_toggles.clone(); let last_rows = last_rows.clone(); let visible_categories = visible_categories.clone(); let onboard_name_rev = onboard_name_rev.clone(); @@ -1620,7 +1620,7 @@ fn main() -> Result<(), slint::PlatformError> { &rows, &profile_names(&known_values), &led_names, - get(&shaping_toggles), + get(&response_toggles), ); } Response::RowUpdated { category, row, error } => { @@ -2008,7 +2008,7 @@ fn main() -> Result<(), slint::PlatformError> { { let worker = worker.clone(); let current_category = current_category.clone(); - let shaping_toggles = shaping_toggles.clone(); + let response_toggles = response_toggles.clone(); let last_rows = last_rows.clone(); let known_values = known_values.clone(); let led_slot_names = led_slot_names.clone(); @@ -2017,9 +2017,9 @@ fn main() -> Result<(), slint::PlatformError> { // A per-axis shaping row is view state, not a device attribute: // flip that axis's flag and re-compose the current rows from // the unfiltered cache, without a worker round trip. - if let Some(axis) = shaping::toggle_axis(&attr) { + if let Some(axis) = response_view::toggle_axis(&attr) { let toggles = { - let mut guard = shaping_toggles.lock().unwrap(); + let mut guard = response_toggles.lock().unwrap(); guard.set(axis, value); *guard }; diff --git a/userspace/logi-wheel/crates/logi-wheel-gui/ui/curve_editor.slint b/userspace/logi-wheel/crates/logi-wheel-gui/ui/curve_editor.slint index d9b015a..d1b1857 100644 --- a/userspace/logi-wheel/crates/logi-wheel-gui/ui/curve_editor.slint +++ b/userspace/logi-wheel/crates/logi-wheel-gui/ui/curve_editor.slint @@ -105,7 +105,7 @@ export component CurveEditor inherits Rectangle { Text { // Kept short: the hover ghost in the plot is the real // "you can add a point here" affordance. - text: "Click to add a point; drag to shape; select for exact values."; + text: "Click to add a point; drag to bend it; select for exact values."; font-size: 11px; color: Theme.muted-text-color; wrap: word-wrap; diff --git a/userspace/logi-wheel/crates/logi-wheel-tui/src/app.rs b/userspace/logi-wheel/crates/logi-wheel-tui/src/app.rs index b29e243..b39a682 100644 --- a/userspace/logi-wheel/crates/logi-wheel-tui/src/app.rs +++ b/userspace/logi-wheel/crates/logi-wheel-tui/src/app.rs @@ -8,7 +8,7 @@ use logi_wheel_core::games::{self, SetupAction}; use logi_wheel_core::onboard::{self, OnboardEditor}; use logi_wheel_core::profiles; use logi_wheel_core::setting::Access; -use logi_wheel_core::shaping::{self, ShapingRole}; +use logi_wheel_core::response_view::{self, ResponseRole}; use logi_wheel_core::launchers::{self, DiscoveredGame}; use logi_wheel_core::lightsync; use logi_wheel_core::steam; @@ -269,10 +269,10 @@ pub struct App { /// off (simple, the default) its block shows the sensitivity row and /// hides the curve row; while on, the other way around. Deadzones show /// either way. Each axis is rendered as a synthetic toggle row - /// (`shaping::toggle_attr`) heading its block on the Steering/Pedals + /// (`response_view::toggle_attr`) heading its block on the Steering/Pedals /// pages; Enter on that row (or 'a' anywhere in the axis's block) /// flips it. - pub shaping_toggles: shaping::AxisToggles, + pub response_toggles: response_view::AxisToggles, /// The Setup view's SDK folder field text (see `sdk_field_prefill` for /// the startup value, `s` in the Setup view to edit it). The field is /// only the first candidate; `sdk_resolved` holds the actual outcome. @@ -481,7 +481,7 @@ impl App { add_game: None, next_wheel_requested: false, quit: false, - shaping_toggles: shaping::AxisToggles::default(), + response_toggles: response_view::AxisToggles::default(), ffb_path: logi_wheel_core::helpers::ffb_path(), launch_bin: logi_wheel_core::helpers::launch_path(), shim_binary: logi_wheel_core::helpers::installer_path(), @@ -708,7 +708,7 @@ impl App { self.profiles_rows() } else { let rows = self.registry_rows(cat); - self.shaping_rows(rows) + self.response_view_rows(rows) }; if self.row_idx >= self.rows.len() { self.row_idx = self.rows.len().saturating_sub(1); @@ -1106,16 +1106,16 @@ impl App { /// Compose a category's rows for the per-axis shaping toggles: when any /// row is a shaping generator (a sensitivity or a curve; see - /// `shaping::role`), insert each axis's synthetic toggle row right + /// `response_view::role`), insert each axis's synthetic toggle row right /// before that axis's first row (its block heading) and keep only the - /// rows `shaping::visible` allows for the current toggles (an axis on + /// rows `response_view::visible` allows for the current toggles (an axis on /// sensitivity hides its curve, an axis on the curve hides its /// sensitivity, deadzones and everything else stay). Rows for a /// category with no shaping generators pass through untouched, so /// `reload` can call this unconditionally, matching the GUI's - /// `compose_shaping`. - fn shaping_rows(&self, rows: Vec) -> Vec { - if !rows.iter().any(|r| shaping::role(&r.attr) != ShapingRole::Neutral) { + /// `compose_response_view`. + fn response_view_rows(&self, rows: Vec) -> Vec { + if !rows.iter().any(|r| response_view::role(&r.attr) != ResponseRole::Neutral) { return rows; } // An axis with no available generator row has nothing for its toggle to @@ -1123,26 +1123,26 @@ impl App { // attached), so it gets no toggle at all rather than one that offers a // choice which cannot change anything. Keyed on availability, not on // the handbrake specifically, so any future axis behaves the same way. - let live: Vec = shaping::Axis::ALL + let live: Vec = response_view::Axis::ALL .iter() .copied() - .filter(|ax| rows.iter().any(|r| shaping::axis(&r.attr) == Some(*ax) && r.available)) + .filter(|ax| rows.iter().any(|r| response_view::axis(&r.attr) == Some(*ax) && r.available)) .collect(); - let mut out = Vec::with_capacity(rows.len() + shaping::Axis::ALL.len()); - let mut headed: Vec = Vec::new(); + let mut out = Vec::with_capacity(rows.len() + response_view::Axis::ALL.len()); + let mut headed: Vec = Vec::new(); for row in rows { - if let Some(ax) = shaping::axis(&row.attr) { + if let Some(ax) = response_view::axis(&row.attr) { if !headed.contains(&ax) && live.contains(&ax) { headed.push(ax); out.push(Row { - attr: shaping::toggle_attr(ax).to_string(), - label: shaping::toggle_label(ax).to_string(), + attr: response_view::toggle_attr(ax).to_string(), + label: response_view::toggle_label(ax).to_string(), available: true, - value: Ok(Value::Bool(self.shaping_toggles.get(ax))), + value: Ok(Value::Bool(self.response_toggles.get(ax))), }); } } - if shaping::visible(&row.attr, self.shaping_toggles) { + if response_view::visible(&row.attr, self.response_toggles) { out.push(row); } } @@ -1151,18 +1151,18 @@ impl App { /// Whether the on-screen category carries any shaping toggle rows /// (Steering and Pedals do). - pub fn has_shaping_toggle(&self) -> bool { - self.rows.iter().any(|r| shaping::toggle_axis(&r.attr).is_some()) + pub fn has_response_toggle(&self) -> bool { + self.rows.iter().any(|r| response_view::toggle_axis(&r.attr).is_some()) } /// Flip one axis's shaping view toggle and re-compose the page. Pure /// view state: nothing is written to the device. - pub fn toggle_shaping(&mut self, axis: shaping::Axis) { - self.shaping_toggles.toggle(axis); + pub fn toggle_response_view(&mut self, axis: response_view::Axis) { + self.response_toggles.toggle(axis); self.status = format!( "{}: {}", - shaping::toggle_label(axis), - if self.shaping_toggles.get(axis) { "curve editor" } else { "sensitivity" } + response_view::toggle_label(axis), + if self.response_toggles.get(axis) { "curve editor" } else { "sensitivity" } ); self.reload(); } @@ -1173,11 +1173,11 @@ impl App { pub fn toggle_selected_axis(&mut self) { let Some(axis) = self .selected() - .and_then(|r| shaping::toggle_axis(&r.attr).or_else(|| shaping::axis(&r.attr))) + .and_then(|r| response_view::toggle_axis(&r.attr).or_else(|| response_view::axis(&r.attr))) else { return; }; - self.toggle_shaping(axis); + self.toggle_response_view(axis); } fn led_row(&self, attr: &str, label: &str) -> Row { @@ -2042,8 +2042,8 @@ impl App { ModeReq::OnboardOnly => lines.push("Onboard mode only.".to_string()), ModeReq::Any => {} } - } else if shaping::toggle_axis(&row.attr).is_some() { - lines.push(shaping::TOGGLE_HELP.to_string()); + } else if response_view::toggle_axis(&row.attr).is_some() { + lines.push(response_view::TOGGLE_HELP.to_string()); } else if let Ok(Value::Text(hint)) = &row.value { // The profile rows carry their key hint as their value text; // it doubles as the popup body. @@ -2061,8 +2061,8 @@ impl App { }; // A per-axis shaping row is view state, not a device attribute: // Enter flips it in place (same as the 'a' shortcut), no editor. - if let Some(axis) = shaping::toggle_axis(&attr) { - self.toggle_shaping(axis); + if let Some(axis) = response_view::toggle_axis(&attr) { + self.toggle_response_view(axis); return; } let Some(spec) = Device::::spec(&attr) else { return }; @@ -3626,7 +3626,7 @@ mod tests { a.cat_idx = Category::ALL.iter().position(|c| *c == Category::Pedals).unwrap(); // A curve row only shows while its axis's shaping toggle is on (the // default is the simple sensitivity view). - a.shaping_toggles.set(shaping::Axis::Throttle, true); + a.response_toggles.set(response_view::Axis::Throttle, true); a.reload(); a.row_idx = a.rows.iter().position(|r| r.attr == "wheel_throttle_curve").unwrap(); a @@ -3732,12 +3732,12 @@ mod tests { a.row_idx = a .rows .iter() - .position(|r| r.attr == shaping::toggle_attr(shaping::Axis::Throttle)) + .position(|r| r.attr == response_view::toggle_attr(response_view::Axis::Throttle)) .unwrap(); a.on_key(KeyCode::Char('i')); let popup = a.info_popup.as_ref().expect("popup opens on a synthetic row"); - assert_eq!(popup.title, "Throttle shaping"); - assert_eq!(popup.lines, vec![shaping::TOGGLE_HELP.to_string()]); + assert_eq!(popup.title, "Throttle response"); + assert_eq!(popup.lines, vec![response_view::TOGGLE_HELP.to_string()]); } #[test] @@ -4741,7 +4741,7 @@ mod tests { fs.set("wheel_sensitivity", "50"); fs.set("wheel_response_curve", "reset"); // Give every shapeable axis one available generator, so this stands for - // a wheel that actually has these axes: `shaping_rows` heads an axis + // a wheel that actually has these axes: `response_view_rows` heads an axis // block only when the axis has something available to toggle between, // and an axis with no attributes at all is an axis the wheel lacks. for attr in [ @@ -4792,13 +4792,13 @@ mod tests { let hb = a.rows.iter().find(|r| r.attr == "wheel_handbrake_sensitivity").expect("row listed"); assert!(!hb.available, "handbrake sensitivity must read unavailable"); assert!( - !a.rows.iter().any(|r| r.attr == shaping::toggle_attr(shaping::Axis::Handbrake)), + !a.rows.iter().any(|r| r.attr == response_view::toggle_attr(response_view::Axis::Handbrake)), "no handbrake shaping toggle without the accessory" ); // The pedals themselves are untouched by the accessory's absence. let th = a.rows.iter().find(|r| r.attr == "wheel_throttle_sensitivity").expect("row listed"); assert!(th.available); - assert!(a.rows.iter().any(|r| r.attr == shaping::toggle_attr(shaping::Axis::Throttle))); + assert!(a.rows.iter().any(|r| r.attr == response_view::toggle_attr(response_view::Axis::Throttle))); } #[test] @@ -4806,27 +4806,27 @@ mod tests { let a = pedals_app("RS Shifter & Handbrake"); let hb = a.rows.iter().find(|r| r.attr == "wheel_handbrake_sensitivity").expect("row listed"); assert!(hb.available); - assert!(a.rows.iter().any(|r| r.attr == shaping::toggle_attr(shaping::Axis::Handbrake))); + assert!(a.rows.iter().any(|r| r.attr == response_view::toggle_attr(response_view::Axis::Handbrake))); } #[test] - fn shaping_toggles_head_each_axis_block_on_steering_and_pedals_only() { - use shaping::Axis; + fn response_toggles_head_each_axis_block_on_steering_and_pedals_only() { + use response_view::Axis; let a = steering_app(); let attrs: Vec<&str> = a.rows.iter().map(|r| r.attr.as_str()).collect(); // The steering toggle heads the axis block (right before the // sensitivity row), not the whole page. - let toggle = attrs.iter().position(|a| *a == shaping::toggle_attr(Axis::Steering)).unwrap(); + let toggle = attrs.iter().position(|a| *a == response_view::toggle_attr(Axis::Steering)).unwrap(); assert_eq!(attrs[toggle + 1], "wheel_sensitivity"); let mut p = steering_app(); p.cat_idx = Category::ALL.iter().position(|c| *c == Category::Pedals).unwrap(); p.reload(); let pattrs: Vec<&str> = p.rows.iter().map(|r| r.attr.as_str()).collect(); for ax in [Axis::Throttle, Axis::Brake, Axis::Clutch, Axis::Handbrake] { - assert!(pattrs.contains(&shaping::toggle_attr(ax)), "missing {ax:?} toggle"); + assert!(pattrs.contains(&response_view::toggle_attr(ax)), "missing {ax:?} toggle"); } let ffb = app(); // first category, Ffb - assert!(!ffb.has_shaping_toggle(), "Ffb has no shaping generators"); + assert!(!ffb.has_response_toggle(), "Ffb has no shaping generators"); } #[test] @@ -4842,15 +4842,15 @@ mod tests { use crossterm::event::KeyCode; let mut a = steering_app(); a.row_idx = - a.rows.iter().position(|r| r.attr == shaping::toggle_attr(shaping::Axis::Steering)).unwrap(); + a.rows.iter().position(|r| r.attr == response_view::toggle_attr(response_view::Axis::Steering)).unwrap(); a.on_key(KeyCode::Enter); - assert!(a.shaping_toggles.get(shaping::Axis::Steering)); + assert!(a.response_toggles.get(response_view::Axis::Steering)); assert!(a.edit.is_none(), "no inline editor opens"); let attrs: Vec<&str> = a.rows.iter().map(|r| r.attr.as_str()).collect(); assert!(attrs.contains(&"wheel_response_curve")); assert!(!attrs.contains(&"wheel_sensitivity")); // Pure view state: the reserved attr never reaches the device. - assert!(a.device.read(shaping::toggle_attr(shaping::Axis::Steering)).is_err()); + assert!(a.device.read(response_view::toggle_attr(response_view::Axis::Steering)).is_err()); } #[test] @@ -4859,10 +4859,10 @@ mod tests { let mut a = steering_app(); a.row_idx = a.rows.iter().position(|r| r.attr == "wheel_sensitivity").unwrap(); a.on_key(KeyCode::Char('a')); - assert!(a.shaping_toggles.get(shaping::Axis::Steering)); + assert!(a.response_toggles.get(response_view::Axis::Steering)); a.row_idx = a.rows.iter().position(|r| r.attr == "wheel_response_curve").unwrap(); a.on_key(KeyCode::Char('a')); - assert!(!a.shaping_toggles.get(shaping::Axis::Steering)); + assert!(!a.response_toggles.get(response_view::Axis::Steering)); let attrs: Vec<&str> = a.rows.iter().map(|r| r.attr.as_str()).collect(); assert!(attrs.contains(&"wheel_sensitivity"), "back to the simple view"); } @@ -4873,7 +4873,7 @@ mod tests { let mut a = app(); // Ffb let before: Vec = a.rows.iter().map(|r| r.attr.clone()).collect(); a.on_key(KeyCode::Char('a')); - assert_eq!(a.shaping_toggles, shaping::AxisToggles::default()); + assert_eq!(a.response_toggles, response_view::AxisToggles::default()); let after: Vec = a.rows.iter().map(|r| r.attr.clone()).collect(); assert_eq!(before, after); } @@ -4888,7 +4888,7 @@ mod tests { assert!(simple.contains(&"wheel_throttle_sensitivity")); assert!(!simple.contains(&"wheel_throttle_curve")); // Brake to the curve view; the throttle stays on sensitivity. - a.toggle_shaping(shaping::Axis::Brake); + a.toggle_response_view(response_view::Axis::Brake); let mixed: Vec<&str> = a.rows.iter().map(|r| r.attr.as_str()).collect(); assert!(mixed.contains(&"wheel_brake_curve")); assert!(!mixed.contains(&"wheel_brake_sensitivity")); @@ -4896,8 +4896,8 @@ mod tests { assert!(mixed.contains(&"wheel_throttle_sensitivity")); assert!(!mixed.contains(&"wheel_throttle_curve")); // Every axis on the curve view: no sensitivities remain. - for ax in [shaping::Axis::Throttle, shaping::Axis::Clutch, shaping::Axis::Handbrake] { - a.toggle_shaping(ax); + for ax in [response_view::Axis::Throttle, response_view::Axis::Clutch, response_view::Axis::Handbrake] { + a.toggle_response_view(ax); } let curves: Vec<&str> = a.rows.iter().map(|r| r.attr.as_str()).collect(); assert!(curves.contains(&"wheel_throttle_curve")); @@ -4909,8 +4909,8 @@ mod tests { #[test] fn shaping_state_survives_a_category_round_trip() { let mut a = steering_app(); - a.toggle_shaping(shaping::Axis::Steering); - assert!(a.shaping_toggles.get(shaping::Axis::Steering)); + a.toggle_response_view(response_view::Axis::Steering); + assert!(a.response_toggles.get(response_view::Axis::Steering)); a.move_cat(-1); // away to Ffb a.move_cat(1); // and back to Steering let attrs: Vec<&str> = a.rows.iter().map(|r| r.attr.as_str()).collect(); diff --git a/userspace/logi-wheel/crates/logi-wheel-tui/src/keymap.rs b/userspace/logi-wheel/crates/logi-wheel-tui/src/keymap.rs index 667210b..9f4cc5a 100644 --- a/userspace/logi-wheel/crates/logi-wheel-tui/src/keymap.rs +++ b/userspace/logi-wheel/crates/logi-wheel-tui/src/keymap.rs @@ -246,7 +246,7 @@ fn context_section(app: &App) -> (Section, Scope) { } else { keys.push(bfs("d", "toggle desktop/onboard mode", "mode")); } - if app.has_shaping_toggle() { + if app.has_response_toggle() { keys.push(b("a", "sensitivity/curve for the row's axis")); } keys.push(b("r", "refresh")); diff --git a/userspace/logi-wheel/crates/logi-wheel-tui/src/ui.rs b/userspace/logi-wheel/crates/logi-wheel-tui/src/ui.rs index 5f88248..03c8faa 100644 --- a/userspace/logi-wheel/crates/logi-wheel-tui/src/ui.rs +++ b/userspace/logi-wheel/crates/logi-wheel-tui/src/ui.rs @@ -4,7 +4,7 @@ use crate::curve_editor::CurveEditor; use crate::wheel_test::TestView; use logi_wheel_core::fftest::StepState; use logi_wheel_core::sysfs::SysfsIo; -use logi_wheel_core::{shaping, Category, Device, Mode, Value}; +use logi_wheel_core::{response_view, Category, Device, Mode, Value}; use ratatui::buffer::Buffer; use ratatui::layout::{Constraint, Direction, Layout, Rect}; use ratatui::style::{Color, Modifier, Style}; @@ -426,7 +426,7 @@ fn draw_settings(buf: &mut Buffer, app: &App, area: Rect) { _ => "(not on this wheel)".to_string(), }; (why, Style::default().fg(Color::DarkGray)) - } else if shaping::toggle_axis(&row.attr).is_some() { + } else if response_view::toggle_axis(&row.attr).is_some() { // A synthetic per-axis view toggle (no registry spec): // show which shaping control the axis currently offers. let curve = matches!(row.value, Ok(Value::Bool(true))); @@ -628,9 +628,9 @@ fn draw_settings(buf: &mut Buffer, app: &App, area: Rect) { fn draw_status(f: &mut Frame, app: &App, area: Rect) { let plain_settings = !app.is_setup() && !app.is_info() && app.edit.is_none(); let help = if plain_settings - && app.selected().is_some_and(|r| shaping::toggle_axis(&r.attr).is_some()) + && app.selected().is_some_and(|r| response_view::toggle_axis(&r.attr).is_some()) { - shaping::TOGGLE_HELP.to_string() + response_view::TOGGLE_HELP.to_string() } else { crate::keymap::footer(app) };