Keyboard and mouse: gta6-mnk-mod in process (the 0 key) #9
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!9
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-9"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@PhialsBasement on GitHub · 2026-11-29 16:25 UTC · original
PhialsBasement:keyboard-mouse→main· +1074 −5 · 5 files · 1 commits · openRebased on
109cdb5, beside the native andVICTORY_PC_CONTROLSmodes. While this bridge has control (the 0 key), its pad is the stand-in ahead of those modes, the keyboard device is quiet, andcurrent_readingleaves the mouse frame sample out. Given back, the other modes are as before. Key 0 is free innative-keys.default.txt. The difference from PC controls: this one patches the game's camera (look scale, slew and axis snap off) and inverts its look curve, so the camera behaves like a mouse camera, not a faster stick.A port of gta6-mnk-mod (the PS5 Remote Play mouse-and-keyboard bridge) into
gameinput, so the Xbox build plays with keyboard and mouse natively. The README gets a "Keyboard and mouse" section: how to turn it on, the in-game settings it needs, and the keys.What it does
Keyboard → the title's pad, by GTA V's PC defaults where GTA VI has the same action. A vehicle layout (W/S throttle and brake, left click RB, ...) switches in by itself: the bridge reads
INPUT_VEH_ACCELERATEandINPUT_MOVE_UP_ONLYfrom the title's action table, as the mod read them on the PS5.Mouse → camera through the right stick. The stick always shows the mouse's mean rate over the last game frame (the camera's own
dt, read from memory), inverted through the game's stick-to-turn-rate curve, so the camera turns exactly as far as the mouse. Aiming uses the aim curve.Raw mouse under Wine: raw input is registered for the title's window with no target and no flags. Under Wine an input sink gets nothing; this follows focus.
WM_INPUTis taken in the layer's window procedure.The 0 key takes control (cursor hidden and clipped to the window; the keyboard device shows no keys, so nothing gets double input) and gives it back. Ctrl+Alt+Backspace always releases. F10, the mod's key, is the menu key and needed two presses under Wine.
Camera patches after 10 s of play, as the mod applies them:
VICTORY_MNK_LOOK_SCALE);These go through the one call of
CamParam_LookSpeed_Update(0x140A050A0, called directly from0x140E4E799, never through the vtable), redirected to a stub and run on the title's thread. The param layout matches the PS5 build's.Safety: every patch site is checked before it is written (the call's bytes, action ids by hash, the look param's id 58, the snap byte's neighbours), and left alone on anything unexpected, with a log line saying why.
VICTORY_MNK=0turns it all off;run.sh playturns it on.Tested on Wine 11.21, RX 9070 XT, Ryzen 7 5800X3D, Series X profile: played on foot and in vehicles with the camera patches applied (the log confirms each one). The look model and the frame-mean sender have unit tests (
cargo test -p victory-hle mnk).AI-assisted (Claude Code).
🤖 Generated with Claude Code
@Luxuride on GitHub · 2026-12-04 12:00 UTC · original
This is the real feature in this batch — a working in-process M&K path is worth more to users than the micro-optimisations around it. Worth after a rebase, with three things fixed first.
run.sh:37-38exportsVICTORY_MNK=1for every play run. That ships a hardcoded-offset in-process code patcher enabled by default, including on builds where the offsets do not match. Default it to 0 and letrun.confopt in.crates/victory-hle/src/modules/gameinput/mnk.rs:226UPDATE_CALL = 0xe4_e799is byte-checked, but:202ACTION_COUNT = 0xab7_7bd4,:203ACTION_ARRAY = 0xab7_7bd8and:216CAMERA_DT = 0xabb_ef4care read raw. On another build or region that reads garbage for "in vehicle" / "menu open" / look scale and remaps the pad mid-game instead of failing loudly. Validate them like the hook, or gate on an image hash.VICTORY_MNK,VICTORY_MNK_SPEED,VICTORY_MNK_LOOK_SCALE,VICTORY_MNK_INVERT_Yare documented only in the README section. Add them torun.conf.default(anddocs/SETTINGS.md) so the menu can show them — asrun.conf.default:2-3says, a switch that is not there is invisible in F1.Credit for the tests in
mnk.rs:921; what is missing is one measurable claim (aim deviation, frame cost), not correctness.Conflicts are limited to
run.sh, so the rebase itself should be cheap.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.