startup: input script holds, stick and trigger values, a process-start time base #1955

Merged
rasptum merged 1 commit from upstream-pr/1962 into main 2026-11-24 22:23:33 +00:00
rasptum commented 2026-11-24 22:11:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-24T22:11:32Z.


The GameInput stand-in's X2W_INPUT_SCRIPT plays fixed 0.3 s presses timed from the first input poll.
#1859 already reads up to 4,095 characters, keeps up to 256 entries and logs ignored or malformed values.
This keeps those limits and log lines unchanged, and adds what scripted runs still lack:

  • <mask>@<s>+<d> holds the buttons for <d> seconds (default stays 0.3 s). Overlapping entries OR their masks.
  • lx|ly|rx|ry|lt|rt=<value>@<s>[+<d>] sets a stick axis (-1 to 1) or trigger (0 to 1) for a duration, in the
    float units of the stand-in's gamepad state. Among active entries on one axis the later item wins; the axis
    returns to 0 when the entry ends.
  • base=start (first item) times the script from process start; base=poll, the default, keeps the current
    first-poll base.
  • Besides #1859's lines, each rejected item is logged once with its index and reason
    (x2w-input script item <i> rejected (<reason>): "<item>"). A creation line gives the accepted and rejected
    counts and the time base, and the first poll logs the resolved base and the first entry's time.

Every script that is valid today keeps its meaning: the check replays legacy scripts against a copy of the
former parser at every millisecond. The parser and playback are in src/startup_stubs/input_script.h.
X2W_INPUT_CLOCK_MS is a test seam that replaces the script clock.

Test:

ctest --preset dev --no-tests=error -R '^startup_gameinput_(script_(long|entries|syntax)|keys|history|contracts_check)$' -V

Result in dev and release: 6/6 passed, 0 skipped. #1859's startup_gameinput_script_long and
startup_gameinput_script_entries are unchanged. startup_gameinput_script_syntax covers 200 entries
delivered, legacy equivalence, holds, overlapping masks, stick and trigger values returning to neutral, both
time bases, malformed items, 257 entries (the last reported over the limit) and a value over 4,095 characters
(ignored as a whole). Negative control, applied locally: reinstating a 32-entry cap fails the 200-entry case.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592429442 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1962). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-24T22:11:32Z. --- The GameInput stand-in's `X2W_INPUT_SCRIPT` plays fixed 0.3 s presses timed from the first input poll. #1859 already reads up to 4,095 characters, keeps up to 256 entries and logs ignored or malformed values. This keeps those limits and log lines unchanged, and adds what scripted runs still lack: - `<mask>@<s>+<d>` holds the buttons for `<d>` seconds (default stays 0.3 s). Overlapping entries OR their masks. - `lx|ly|rx|ry|lt|rt=<value>@<s>[+<d>]` sets a stick axis (-1 to 1) or trigger (0 to 1) for a duration, in the float units of the stand-in's gamepad state. Among active entries on one axis the later item wins; the axis returns to 0 when the entry ends. - `base=start` (first item) times the script from process start; `base=poll`, the default, keeps the current first-poll base. - Besides #1859's lines, each rejected item is logged once with its index and reason (`x2w-input script item <i> rejected (<reason>): "<item>"`). A creation line gives the accepted and rejected counts and the time base, and the first poll logs the resolved base and the first entry's time. Every script that is valid today keeps its meaning: the check replays legacy scripts against a copy of the former parser at every millisecond. The parser and playback are in `src/startup_stubs/input_script.h`. `X2W_INPUT_CLOCK_MS` is a test seam that replaces the script clock. Test: ```powershell ctest --preset dev --no-tests=error -R '^startup_gameinput_(script_(long|entries|syntax)|keys|history|contracts_check)$' -V ``` Result in dev and release: 6/6 passed, 0 skipped. #1859's `startup_gameinput_script_long` and `startup_gameinput_script_entries` are unchanged. `startup_gameinput_script_syntax` covers 200 entries delivered, legacy equivalence, holds, overlapping masks, stick and trigger values returning to neutral, both time bases, malformed items, 257 entries (the last reported over the limit) and a value over 4,095 characters (ignored as a whole). Negative control, applied locally: reinstating a 32-entry cap fails the 200-entry case. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 23:03:17 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1955
No description provided.