Native 1:1 Mouse & Keyboard, live F10 Controls editor, and bindings-synced HUD prompts #113

Closed
github-bot wants to merge 1 commit from github-bot/gh-113 into main AGit
Owner

@⁠greedtv92 on GitHub · 2026-12-05 18:55 UTC · original
greedtv92:feat/native-mnk-controls → main · +7395 −2097 · 16 files · 1 commits · closed without merging

Unifies direct mouse camera (#46), world map mouse (#78), and mouse.rs into a single, zero-lock native 1:1 Mouse & Keyboard stack (mnk.rs + native_mouse.rs + mousehook.rs), adding Pause/Shop menu cursor hover/click, a live in-game F10 -> Controls keybinding editor, GTA PC driving & minigame controls, and bindings-synced HUD button prompts (coexisting with existing PlayStation / DualSense auto-prompts).

F10 Controls menu

What's Included (on top of latest main)

  • Unified Native 1:1 Raw Mouse Aiming + Map & Menu Cursor (mousehook.rs, native_mouse.rs): combines direct look_pull camera aiming, Map drag/zoom, and Pause/Shop menu cursor hover/click into one hook layer with automatic cursor capture/release (LARP_NATIVE_MOUSE=0 or LARP_MOUSE_CAMERA=stick falls back to right-stick emulation; reuses main's existing callhook.rs unchanged).
  • Live In-Game F10 -> Controls Tab ([Picture] [Controls] [Untested]):
    • Toggle Mouse & Keyboard, mouse sensitivity, invert Y, vehicle auto-center, menu/map mouse, and button prompt mode (auto | keyboard | playstation | xbox).
    • Rebind all 26 controls live to any keyboard key, Mouse1–Mouse5, or WheelUp/WheelDown (Esc cancels, Delete clears) with 0 restart, saved atomically to bindings.ini (LARP_MNK_BINDINGS > bin\bindings.ini > bindings.ini next to options.ini > %LOCALAPPDATA%\larp\bindings.ini).
    • One-click Reset / Preset between Standard (GTA) PC defaults (E / Right for Interact showing [E], C / Mouse3 for Look Behind, Space Handbrake, F Enter Vehicle, Tab Weapon Wheel, Q Cover) and Standard FPS (LS = Shift, A = Ctrl, Enter).
  • GTA PC Driving & Minigames:
    • Dedicated Handbrake (Drive) (Space sends Xbox A while in VehicleSeat::Driver without triggering X, separate from on-foot Jump / Melee).
    • Smart 1.5s Vehicle Camera Auto-Center (auto default: holds camera free while moving the mouse, smoothly auto-centers after 1.5s idle; F8 cycles auto / off / on).
    • 3-Layer Carjacking / Lockpicking / Fishing Right-Stick Support: hold Alt (rebindable RightStickMouse) to steer the 360° analog (R) stick with the mouse while pausing camera look, automatic mouse → Right-Stick fallback when a minigame locks the camera, plus circular-normalized I/J/K/L keys.
  • Bindings-Synced Keyboard/Mouse HUD Prompts + Wine/Proton Font Fallbacks:
    • Prompts = auto keeps PlayStation symbols automatically when a DualSense/DS4 pad is connected, and otherwise draws keyboard & mouse keycaps matching the user's bindings.ini and AZERTY/QWERTZ printed letters (plus F1–F12, Caps, Ins/Del/Home/End/PgUp/PgDn labels).
    • Adds Wine/Proton GDI font fallbacks (Tahoma, DejaVu Sans, MS Gothic) in prompts/font.rs.
  • Zero-Lock Hot Paths (High-Polling Mouse Friendly):
    • Lock-free atomic hot settings, OnceLock hook checks, fast-pathed WM_INPUT, skipped WM_MOUSEMOVE during gameplay capture, and sub-nanosecond ui_screens_before guard (benchmark included as #[ignore] hot_path_bench in native_mouse.rs).
  • Hotkeys: F7 First-Person toggle (preserved), F8 cycle vehicle auto-center, F11 manual mouse capture lock, [ / ] live mouse sensitivity.

Preserved Compatibility

  • Rebased cleanly onto latest main (334be94): keeps F7 First-Person toggle (#86), MVFG (#98), HUDLess FG (#84), NVAPI CVV (#104), 9-language F10 i18n (incl. es & pt-BR), PlayStation / DualSense HID & adaptive triggers, auto PlayStation prompts, controller F10 chord (View + Menu / LB + RB + View), dark title bar theming, Z-ROX trainer share page, and LARP_CONTROLS=pad / LARP_MNK=0 / LARP_MOUSE_CAMERA=stick / LARP_MAP_MOUSE=0 overrides intact.
  • Adds bindings.ini to ziplogs.rs alongside options.ini and controls.ini.

Verification

  • cargo test -p larp-loader --lib callhook — 3/3 passed
  • cargo test -p larp-game --lib prompts — 60/60 passed (both Keyboard KeyCaps & PlayStation prompt suites)
  • cargo test -p larp-hle --lib — 59/59 passed (0 failed)
  • cargo build --release -p larp — built cleanly with 0 new warnings
  • Verified in-game on Series X profile (aiming, [E] HUD prompts, F10 -> Controls rebinding, map/menu mouse, driving auto-center/handbrake).

Credits & License

GPL-3.0-or-later. Native camera/map/menu hooks, bindings.ini format, and Wine/Proton prompt font fallbacks ported from Darner (tyr0nsur/Darner, GPL-3.0-or-later).

**@⁠greedtv92** on GitHub · 2026-12-05 18:55 UTC · [original](https://github.com/gamingwithhomie/larp/pull/113) `greedtv92:feat/native-mnk-controls` → `main` · +7395 −2097 · 16 files · 1 commits · closed without merging Unifies direct mouse camera (#46), world map mouse (#78), and `mouse.rs` into a single, zero-lock **native 1:1 Mouse & Keyboard stack** (`mnk.rs` + `native_mouse.rs` + `mousehook.rs`), adding **Pause/Shop menu cursor hover/click**, a **live in-game `F10 -> Controls` keybinding editor**, **GTA PC driving & minigame controls**, and **bindings-synced HUD button prompts** (coexisting with existing PlayStation / DualSense auto-prompts). ![F10 Controls menu](https://git.gtahub.st/GreedTV92/CNF-Larp/raw/branch/main/docs/controls-menu.png) ### What's Included (on top of latest `main`) - **Unified Native 1:1 Raw Mouse Aiming + Map & Menu Cursor (`mousehook.rs`, `native_mouse.rs`):** combines direct `look_pull` camera aiming, Map drag/zoom, and **Pause/Shop menu cursor hover/click** into one hook layer with automatic cursor capture/release (`LARP_NATIVE_MOUSE=0` or `LARP_MOUSE_CAMERA=stick` falls back to right-stick emulation; reuses `main`'s existing `callhook.rs` unchanged). - **Live In-Game `F10 -> Controls` Tab (`[Picture] [Controls] [Untested]`):** - Toggle Mouse & Keyboard, mouse sensitivity, invert Y, vehicle auto-center, menu/map mouse, and button prompt mode (`auto | keyboard | playstation | xbox`). - Rebind all 26 controls live to any keyboard key, `Mouse1`–`Mouse5`, or `WheelUp`/`WheelDown` (`Esc` cancels, `Delete` clears) with **0 restart**, saved atomically to `bindings.ini` (`LARP_MNK_BINDINGS` > `bin\bindings.ini` > `bindings.ini` next to `options.ini` > `%LOCALAPPDATA%\larp\bindings.ini`). - One-click **`Reset / Preset`** between **Standard (GTA)** PC defaults (`E` / `Right` for Interact showing `[E]`, `C` / `Mouse3` for Look Behind, `Space` Handbrake, `F` Enter Vehicle, `Tab` Weapon Wheel, `Q` Cover) and **Standard FPS** (`LS = Shift`, `A = Ctrl, Enter`). - **GTA PC Driving & Minigames:** - Dedicated `Handbrake (Drive)` (`Space` sends Xbox `A` while in `VehicleSeat::Driver` without triggering `X`, separate from on-foot `Jump / Melee`). - **Smart 1.5s Vehicle Camera Auto-Center** (`auto` default: holds camera free while moving the mouse, smoothly auto-centers after 1.5s idle; `F8` cycles `auto` / `off` / `on`). - **3-Layer Carjacking / Lockpicking / Fishing Right-Stick Support:** hold **`Alt`** (rebindable `RightStickMouse`) to steer the 360° analog `(R)` stick with the mouse while pausing camera look, automatic mouse → Right-Stick fallback when a minigame locks the camera, plus circular-normalized `I`/`J`/`K`/`L` keys. - **Bindings-Synced Keyboard/Mouse HUD Prompts + Wine/Proton Font Fallbacks:** - `Prompts = auto` keeps **PlayStation symbols** automatically when a DualSense/DS4 pad is connected, and otherwise draws **keyboard & mouse keycaps** matching the user's `bindings.ini` and AZERTY/QWERTZ printed letters (plus `F1`–`F12`, `Caps`, `Ins`/`Del`/`Home`/`End`/`PgUp`/`PgDn` labels). - Adds Wine/Proton GDI font fallbacks (`Tahoma`, `DejaVu Sans`, `MS Gothic`) in `prompts/font.rs`. - **Zero-Lock Hot Paths (High-Polling Mouse Friendly):** - Lock-free atomic hot settings, `OnceLock` hook checks, fast-pathed `WM_INPUT`, skipped `WM_MOUSEMOVE` during gameplay capture, and sub-nanosecond `ui_screens_before` guard (benchmark included as `#[ignore] hot_path_bench` in `native_mouse.rs`). - **Hotkeys:** `F7` First-Person toggle (preserved), `F8` cycle vehicle auto-center, `F11` manual mouse capture lock, `[` / `]` live mouse sensitivity. ### Preserved Compatibility - Rebased cleanly onto latest `main` (`334be94`): keeps **`F7` First-Person toggle (#86)**, **MVFG (#98)**, **HUDLess FG (#84)**, **NVAPI CVV (#104)**, **9-language `F10` i18n** (incl. `es` & `pt-BR`), **PlayStation / DualSense HID & adaptive triggers**, **auto PlayStation prompts**, **controller `F10` chord** (`View + Menu` / `LB + RB + View`), **dark title bar theming**, **Z-ROX trainer share page**, and **`LARP_CONTROLS=pad` / `LARP_MNK=0` / `LARP_MOUSE_CAMERA=stick` / `LARP_MAP_MOUSE=0`** overrides intact. - Adds `bindings.ini` to `ziplogs.rs` alongside `options.ini` and `controls.ini`. ### Verification - `cargo test -p larp-loader --lib callhook` — **3/3 passed** - `cargo test -p larp-game --lib prompts` — **60/60 passed** (both Keyboard KeyCaps & PlayStation prompt suites) - `cargo test -p larp-hle --lib` — **59/59 passed** (0 failed) - `cargo build --release -p larp` — built cleanly with **0 new warnings** - Verified in-game on Series X profile (aiming, `[E]` HUD prompts, `F10 -> Controls` rebinding, map/menu mouse, driving auto-center/handbrake). ### Credits & License GPL-3.0-or-later. Native camera/map/menu hooks, `bindings.ini` format, and Wine/Proton prompt font fallbacks ported from **Darner** (`tyr0nsur/Darner`, GPL-3.0-or-later).
Replaces right-stick mouse emulation with Darner's native 1:1 raw mouse aiming
(callhook + mousehook), interactive Map drag/zoom, Pause/Shop menu cursor
hover/click, live F10 -> Controls keybinding editor, seat-aware driving
Handbrake (Space) & 1.5s smart vehicle auto-center, Alt + mouse 360-degree
Right-Stick mode for carjacking/fishing, bindings-synced HUD keycap prompts
(coexisting with auto PlayStation DualSense prompts), and zero-lock hot-path
optimizations for high-polling gaming mice.

Preserves all existing larp features: PlayStation/DualSense HID & adaptive
triggers, 7-language F10 i18n, controller F10 menu chord, dark title bar
theming, Z-ROX trainer share page, and LARP_CONTROLS=pad compatibility.

Credits: native camera/map/menu hooks, callhook, bindings.ini format, and
Wine/Proton prompt font fallbacks ported from Darner (tyr0nsur/Darner,
GPL-3.0-or-later).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 19:00:55 +00:00
github-bot force-pushed github-bot/gh-113 from a0e8c4fa90 to eefe3d8fa1 2026-12-05 19:08:12 +00:00 Compare
Author
Owner

@⁠gamingwithhomie on GitHub · 2026-12-05 19:12 UTC · original

Reviewed - holding: this overlaps the just-merged #46 (direct mouse camera), #78 (map mouse), #86 (first-person/F7) and the v1.0.8 Darner mouse-look/controls work, and is a very large input overhaul (+7395/-2097). Please rebase on current main and split into reviewable pieces (native mouse, F10 controls editor, HUD prompts) with each behind the existing opt-ins, so we can test-merge without replacing the working input path blindly. Thank you!

**@⁠gamingwithhomie** on GitHub · 2026-12-05 19:12 UTC · [original](https://github.com/gamingwithhomie/larp/pull/113#issuecomment-7443786435) Reviewed - holding: this overlaps the just-merged #46 (direct mouse camera), #78 (map mouse), #86 (first-person/F7) and the v1.0.8 Darner mouse-look/controls work, and is a very large input overhaul (+7395/-2097). Please rebase on current main and split into reviewable pieces (native mouse, F10 controls editor, HUD prompts) with each behind the existing opt-ins, so we can test-merge without replacing the working input path blindly. Thank you!
github-bot closed this pull request 2026-12-05 19:54:59 +00:00
Author
Owner

@⁠greedtv92 on GitHub · 2026-12-05 19:51 UTC · original

Thanks for the clear review! I've rebased onto latest main and split #113 into 3 small, independent, non-breaking PRs that build directly on top of your existing mouse.rs, mousehook.rs (#46), mapmouse.rs (#78), and bound_keys() (#109) without replacing the working input path:

  1. #143 — Prompts: Wine/Proton GDI font fallbacks + F1–F12/nav keycap labels (+52/-6, 2 files)
  2. #150 — Live F10 -> Controls editor layered directly on top of mouse.rs + controls.ini (4 files, zero changes to default input behavior)
  3. #153 — Opt-in LARP_MOUSE_CAMERA=direct upgrades: 1.5s smart vehicle auto-center (F8), seat-aware Space handbrake, Alt + mouse Right-Stick mode for carjacking/fishing, and hot-path caching (2 files, leaves default stick path & mapmouse.rs untouched)

Closing this monolithic PR in favor of those three!

**@⁠greedtv92** on GitHub · 2026-12-05 19:51 UTC · [original](https://github.com/gamingwithhomie/larp/pull/113#issuecomment-7444328653) Thanks for the clear review! I've rebased onto latest `main` and split #113 into 3 small, independent, non-breaking PRs that build directly on top of your existing `mouse.rs`, `mousehook.rs` (#46), `mapmouse.rs` (#78), and `bound_keys()` (#109) without replacing the working input path: 1. **#143** — Prompts: Wine/Proton GDI font fallbacks + `F1`–`F12`/nav keycap labels (+52/-6, 2 files) 2. **#150** — Live `F10 -> Controls` editor layered directly on top of `mouse.rs` + `controls.ini` (4 files, zero changes to default input behavior) 3. **#153** — Opt-in `LARP_MOUSE_CAMERA=direct` upgrades: 1.5s smart vehicle auto-center (`F8`), seat-aware `Space` handbrake, `Alt` + mouse Right-Stick mode for carjacking/fishing, and hot-path caching (2 files, leaves default stick path & `mapmouse.rs` untouched) Closing this monolithic PR in favor of those three!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.