prompt_glyphs.md: the glyph movie's ActionScript is a symbol library with no
logic; the name is built, and a new sprite made at every prompt set-up, by a
class three larger movies carry, which loads the movie once and has a per-prompt
device suffix nothing on this build sets. The keyboard-and-mouse replacement and
its measured size and differences; the runtime's choice by family; and what is
certain and what is a guess about following a device switch during play.
gameinput.md: the start family from what is connected, and the switch guard as
it behaves.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
d3d12/README.md lists the keys on foot and in a vehicle. docs/gameinput.md
has the two tables with the pad button of each key, the GTA V keys left
out and why, the hand-over rule, what is read from the title (and that it
was read from the code, not yet seen running), the speed rule's limits and
the switches. docs/mod-menu.md counts the eleventh place.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The keyboard pad clips the cursor to the foreground window's client
area and re-applies the clip every 100 ms. A press on the title bar was
pulled into the client area, and during the modal move loop each re-clip
pulled the cursor, and the window with it, down the screen instead of
letting it be dragged.
The clip is now released while the window's thread is in a move/size or
menu loop (GetGUIThreadInfo: GUI_INMOVESIZE, GUI_INMENUMODE,
GUI_SYSTEMMENUMODE), and while a mouse press that began outside the
client area is held, including one that activated the window. A press
in the client area keeps the clip, so a click still cannot land on
another window. The decision is CursorClipGate (shims/gameinput_clip.h),
covered by the new gameinput_clip test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sony pads (USB and Bluetooth) are read from the public HID report layouts without SDL, rumble goes out as output reports, and a pad
that XInput already shows through a remapper is not read twice. gameinput::active_family() says Xbox, PlayStation or keyboard and
mouse (LEONIDA_PROMPTS forces it). Unit-tested on hand-made report bytes; not run against a real pad.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What: the console title turns its camera with the right stick only, so the mouse's
motion (cursor re-centred each 8 ms sample, kept in the window with ClipCursor) becomes
a right-stick push merged into the pad the title plays with: speed over a 40 ms window,
full push at 1600 px/s (LEONIDA_MOUSE_SENSITIVITY scales it), lifted past a 0.24 dead
zone with a 0.6 power curve (LEONIDA_MOUSE_DEADZONE, LEONIDA_MOUSE_CURVE),
LEONIDA_MOUSE_INVERT_Y=1. The cursor is hidden over the window while held (WM_SETCURSOR
in both window procedures, leonida_gpu::MOUSE_CAPTURED). The click that takes the mouse
is not a shot; the mouse buttons are the triggers only while held. Esc, the F1 or F4
menu, or another window in front gives the mouse back. LEONIDA_MOUSE_LOOK=0 restores
the old behaviour. Also: held_from_file has a stand-in without diagnostics, so a
non-diagnostics build compiles again.
Why: the user saw the cursor stay on screen and the mouse not turn the camera.
How checked: cargo test -p leonida-hle --lib gameinput (13 pass, one new); not yet
tried in the title. AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The keyboard-and-mouse stand-in pad had its triggers on Z and V only. Now the right mouse button pulls the left
trigger and the left button the right trigger, fully while held, in addition to Z and V. They count only while a window
of the runtime has focus (as the keys do), are not read while the F4 trainer menu is open, and the F1 menu already
returns no keys. The buttons travel as pseudo keys (virtual keys 1 and 2) into the pad and are removed before the
keyboard device reports its keys, so the title never sees them as keyboard input.
Checked: cargo test -p leonida-hle --features diagnostics --lib gameinput (12 passed, including the new
mouse_buttons_pull_the_triggers_and_stay_off_the_keyboard), cargo check --profile diag -p leonida --features
diagnostics. Not run in the game. docs/gameinput.md gains the D3D12 runtime's control table. AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2372 started a detached thread that took the input lock every 8 ms, so that a scripted press that begins and ends
while the title is not reading reaches the reading history. That works around the cause and adds its own: the
history then depends on how the host schedules a Sleep(8) thread (a slow or loaded machine keeps fewer edges, and a
Windows timer tick of 15.6 ms drops a short hold), the thread never ends, and it contends with the title's reads.
The cause is that update() looked only at the state at the moment of the read. It now first adds a reading for every
start and end of a press since the last update, stamped with the script's time, then the state at the read: the
history is the same however often the title reads, on any machine, and no thread runs. The press log lines carry the
script's time of the press.
Also: LEONIDA_INPUT_TRACE (added by #2372) is documented in docs/gameinput.md and runtime/README.md, as
tests/test_docs_env_vars.py requires. gameinput_no_sdl_script gains y@10, which the title never reads while it is down
(reads at 4.5 s and 60 s): the press and its release must be in the history with their own timestamps. On main the
history has no Y reading.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_docs_env_vars.py requires every variable the code reads to be named in a document; the night's diagnostics were not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port VIctory's GameInput module (gameinput.rs, gameinput/dualsense.rs,
GPL-3.0-or-later) as shims/gameinput_xinput.cpp: XInput pads 0-3, a
wired DualSense over HID, the keyboard as its own device, and a keyboard
pad that stands in while no other pad is connected. Readings per change
with a 32-deep history, blocking and async device enumeration,
UnregisterCallback waiting for a running callback, FindDeviceFromId and
XInput rumble, all as VIctory runs the title.
It is built into gta6rt when the SDL3 shim is not (the main build has no
SDL3), instead of binding the import to the host's GameInput.dll, which
has no keyboard pad; LEONIDA_GAMEINPUT=host keeps that path and
LEONIDA_KEYBOARD_PAD=off drops the keyboard pad. Registered by name and
ordinal #1. gameinput_xinput_test runs it over a fake host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2098 gave the SDL path its own loop (held 300 ms, then until the title
has read the pads six times, at most 5 s), which ignored button@seconds:hold.
A press now lasts its own hold, then the read latch, and never past 5 s or
its hold if longer. The long-script test checks both: X kept past 300 ms
until six reads, Y kept for its 0.6 s after them. It fails on the old loop.
Found by AndreiKocherzhinskiiA on #1608.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At world-start frame rates the retail title reads its pad every few seconds,
so a 0.3 s scripted press falls between two reads and never arrives. An
entry may now give its own hold time; without one the press stays 0.3 s.
Holds of 0 or less, over 600 s or that are not a number reject the entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fall back to a dedicated buffer allocation when the shared arena fills.
Update console descriptors and resource backing, preserve pipeline cache
entries, and replay mesh records using bounded indirect arguments. Keep
scripted input available until read and cover the runtime and translator
paths with synthetic tests.
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
A build without SDL3 answered GameInputCreate with no devices and E_NOTIMPL
for every other slot, so the title waited at its first "press A" prompt
forever: no CI artifact or offline build could get past it.
With LEONIDA_INPUT_SCRIPT set, gameinput_no_sdl.cpp now serves one scripted
pad (an Xbox One gamepad) driven by the script alone: device enumeration
through RegisterDeviceCallback (blocking, async, dispatcher), FindDeviceFromId,
and GetCurrentReading/GetNextReading/GetPreviousReading whose gamepad and UI
navigation state follow the script. Readings are taken when the title asks,
so no thread polls. Without the variable it behaves as before.
The parser, the 300 ms timeline, the button names, the press log lines and
the UI navigation mapping move from gameinput.cpp into gameinput_script.h,
which both shims use; nothing in it needs SDL. gameinput.cpp checks the
shared SDL button numbers against SDL_GamepadButton at compile time.
gameinput_no_sdl_test --input-script (CTest gameinput_no_sdl_script) checks
the scripted pad on a fake clock. Docs: runtime/README.md, docs/gameinput.md,
docs/linux_proton.md, docs/README.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pad connected after the title started was seen by the shim but not by the
title, while pads present at start worked. Pads present at start reach a title
through blocking enumeration, which runs synchronously in RegisterDeviceCallback.
A later pad reaches it only through a queued connect event. queue_event queued
every reading and guide change whether or not any callback listened. With a
dispatcher held, a title that runs one item a frame (Dispatch(0), the pattern
Microsoft's Dispatch page suggests) falls further behind every frame, because a
moving stick or a sensor pad's 125 Hz stream queues items faster. The later
pad's connect event then never comes out of the queue.
queue_event now drops an event no registered callback matches, as GameInput has
no work to dispatch then. The first few RegisterDeviceCallback calls and the
first CreateDispatcher and Dispatch calls are logged, so a retail run shows
whether the title holds a dispatcher (not yet confirmed for the retail title).
Test: test_late_pad_behind_dispatcher. A title with a dispatcher registers its
device callback with no pad, a first pad moves on every poll, and a pad attached
later must reach the callback within ten frames of Dispatch(0). Without the fix
it fails (2 of 371 checks); with it, 371 checks pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merging.
**Why merged:** DOC-GAMEINPUT-API-DUPES: removes two stale duplicate rows from the docs/gameinput.md API table. KernelSmoker approved it.
**Why it's good:** Docs tests: 47 passed.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Main had no keyboard pad script scheduler. Add timed button presses with
a full-length environment reader so entries beyond byte 63 reach the pad.
Combine scheduled and physical presses. Reject malformed entries and
report their count when the script is read on the first pad update.
Build gta6rt and gameinput_test. Exercise a long script, rejected items,
focus loss, configuration reload and release under Wine. Restore only the
old environment reader to reproduce the missing presses.
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
AI-assisted (Codex and Claude Code agents).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
gameinput_abi.h left out the labels of the public v0 layout. In
GameInputControllerAxisInfo and GameInputControllerButtonInfo a label
sits at offset 4, in what is otherwise padding, so the sizes matched
while isContinuous, restValue, legacyDInputIndex and rawReportIndex were
four bytes early. GameInputGamepadInfo and GameInputUiNavigationInfo are
tables of 14 and 21 labels; they were declared empty, and the pointers
in GameInputDeviceInfo led to one-byte members, so a title reading a
label read whatever followed.
The header declares the enum, the two tables and the two label members
and pins each offset that moved. fill_info gives every control the Xbox
label of its position on every pad, since every pad is presented as an
Xbox One pad.
gameinput_test reads the tables by the public header's byte offsets, so
the shim's own header cannot agree with itself.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
gameinput_probe with a DualSense (054c:0ce6) over USB on Windows 11: it
connects with trigger effects and gyro, each of the 14 gamepad buttons
sets its own bit of the mapping table, triggers and sticks reach full
scale, the accelerometer clamps at 1.00 on a hand shake, and the raw HID
tables and a changing raw input report are there. Rumble, trigger effects
and the lightbar are as reported by the person holding the pad.
Bluetooth, the resistance trigger mode, a DualShock 4 and a Switch Pro
are still to confirm.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`--force-feedback` now reads the shim's output state once the poll thread has
picked the effect up, and says whether SDL created it and is running it, or why
it did not, so a wheel owner can tell a silent drop from a real run. The shim
records SDL_CreateHapticEffect's id, SDL_RunHapticEffect's result and SDL's
error text per device; gameinput_test asserts the success and the refusal.
AI-assisted
`--force-feedback` creates a constant effect at magnitude 1.0 on motor 0 and
holds it for a second, so the wheel owner the RT-160 finding asks for can feel
the magnitude and the axis instead of only reading `forcefeedback=`; a pad with
no force-feedback motor is skipped with the reason printed. Docs and the probe
comment name the flag.
AI-assisted
docs/gameinput.md listed IGameInputDevice and IGameInputDispatcher twice with contradicting cells. Keep the rows that match runtime/shims/gameinput.cpp: force feedback and haptic motors are implemented, and Dispatch runs its quota; drop the stale duplicates.
The shim tells the title every pad is an Xbox One pad, so nothing could
say what the player is really holding. rt::gameinput::active_input()
now returns the family of the device used last (Xbox, PlayStation 5,
PlayStation 4, PlayStation 3, Nintendo, or the keyboard pad), a
generation that counts changes, and whether LEONIDA_PROMPTS forced it.
It is groundwork for button prompts that follow the device in use.
Only deliberate input counts: a button going down, a trigger past 0.3
or a stick leaving a 0.35 radius. Held input, stick drift and noise do
not; a pad's first reading after it connects is its baseline; and
after a change the next one waits LEONIDA_PROMPTS_SWITCH_MS (300 ms).
The rules live in runtime/src/active_input.h with no SDL, tested by
active_input_test; gameinput_test drives them on SDL virtual pads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- gameinput_host_test decides the skip before mapping: LoadLibraryExW of GameInput.dll from System32. Only "not found"
skips (77); an import that then binds to nothing is a failure. Breaking host ordinal binding in Loader::resolve now
fails the test (4 failures) instead of skipping.
- The gameinput_host fixture links in Debug: /RTC1 with /NODEFAULTLIB left _RTC_InitBase, _RTC_Shutdown and
_RTC_CheckStackVars unresolved, so the fixture defines them as no-ops when runtime checks are on.
- The fixture reports E_FAIL, not S_OK, when GameInputCreate fails, and the test counts a gamepad as attached only when
the library was created.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- shader_disasm: prune stale listings against every input, not the --skip-existing remainder (a resumed run
deleted every listing it had just reused).
- progress_dashboard: a drive-letter path is never inside the repository off Windows (it printed user names);
its own read_text helper is read_utf8, so the encoding check does not take it for pathlib's.
- Translator tests follow this round's rules: desc_lookup's BroadcastFirst in the typed-load condition walker;
resinfo sizes are 0 past the last level and a 2D depth word is 0 (SHADER-388); SHADER-315 constant folding in
the perm and i16 tests; #2089's structured wave64 emulation.
- test_semantic_translator_use: 57 oracle-only files merged before it are DEBT; test_spirv_tools_required is
allowed (CI meta-test).
- Test fixes: image_fuzz fake writes the programs, preflight follows c506d00c's loader hint rule, feature_scan
reads the first line of a pytest-decorated message, w64_graphics wording.
- docs: rows merged again in design.md, README.md, d3d12_vulkan.md; GameInput table rebuilt from #3172's rows;
orphan rows in models.md and embedded_shaders.md; repeated bullets; anchors; a flag not on main.
- Repo rules: stdout guard on 14 programs; LF writes; csv lineterminator in bink_play.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/gameinput.md says that without the SDL3 shim the loader binds
GameInputCreate to the host's GameInput.dll, but nothing tested it.
gameinput_host_test maps a CRT-free fixture DLL built against the SDK's
gameinput.lib and checks that the import binds to the host copy (the test links
no shim table), that GameInputCreate and GetCurrentTimestamp work from mapped
code, that GetCurrentReading answers, and, with a pad attached, that
GetGamepadState succeeds. It skips (77) where there is no GameInput.dll, and is
only built when gameinput.lib is found.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Keep RT-160's force-feedback interface and tests next to the raw HID ones.
The raw HID test fakes are renamed (FakeRawHid, raw_*) so they no longer clash
with the haptic fakes. The API table gets one IGameInputDevice row with both
feature sets; the stale duplicate IGameInputDevice and IGameInputDispatcher
rows are dropped.