diff --git a/docs/first_run_ui.md b/docs/first_run_ui.md index 11db318735..66b147ddbb 100644 --- a/docs/first_run_ui.md +++ b/docs/first_run_ui.md @@ -30,7 +30,7 @@ Run the title offline. The Winsock shim permits loopback and the WinHTTP shim re & (Join-Path $port 'gta6rt.exe') --first-run-ui (Join-Path $game 'game_scarlett_master.exe') ``` -The profile selects Vulkan, a 2 GiB graphics address arena, on-demand pipelines, console root-argument layout, frame pacing and the keyboard gamepad. GPU completion labels (`LEONIDA_GPU_LABELS`) are not part of it: the list values land the title's list writes, and two writers of one address could rewind a counter. Explicit environment settings take precedence; a variable that is set but empty does not count. Speech synthesis through the host's own runtime is not part of the profile: `LEONIDA_LOCAL_SPEECH=1` turns it on, and without it the silent voice answers. The switches are listed in [`runtime/README.md`](../runtime/README.md). The package directory is the working directory. Guest output goes under `first-run-ui/overlay` beside the runtime, and sparse physical-memory backing uses `first-run-ui/xmem` on that volume. Use `--overlay DIR` or the absolute directory in `LEONIDA_XMEM_BACKING_DIR` to choose other writable locations. +The profile selects Vulkan, a 2 GiB graphics address arena, on-demand pipelines, console root-argument layout, frame pacing and the keyboard gamepad in its focused mode (`LEONIDA_KEYBOARD_PAD=1`: keys count only while the title window has focus, so typing into another program presses nothing on a consent page; scripted presses still run). GPU completion labels (`LEONIDA_GPU_LABELS`) are not part of it: the list values land the title's list writes, and two writers of one address could rewind a counter. Explicit environment settings take precedence; a variable that is set but empty does not count. Speech synthesis through the host's own runtime is not part of the profile: `LEONIDA_LOCAL_SPEECH=1` turns it on, and without it the silent voice answers. The switches are listed in [`runtime/README.md`](../runtime/README.md). The package directory is the working directory. Guest output goes under `first-run-ui/overlay` beside the runtime, and sparse physical-memory backing uses `first-run-ui/xmem` on that volume. Use `--overlay DIR` or the absolute directory in `LEONIDA_XMEM_BACKING_DIR` to choose other writable locations. ## Contributions diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 57ccce76a8..dea2b0fa1b 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -1709,7 +1709,7 @@ if(BUILD_TESTING) # game's exact exit code comes back through the relaunch. add_test(NAME run_tiny_first_run_ui COMMAND gta6rt --first-run-ui $ -- hello 42 first-run-ui) set_tests_properties(run_tiny_first_run_ui PROPERTIES - ENVIRONMENT "LEONIDA_ARENA_MB=768;LEONIDA_D3D12=;LEONIDA_PIPELINE_COMPILE=" + ENVIRONMENT "LEONIDA_ARENA_MB=768;LEONIDA_D3D12=;LEONIDA_PIPELINE_COMPILE=;LEONIDA_KEYBOARD_PAD=" PASS_REGULAR_EXPRESSION "tiny_game: PASS first-run UI caller override" FAIL_REGULAR_EXPRESSION "tiny_game: FAIL") add_test(NAME run_tiny_game_fixed COMMAND gta6rt --run $ -- hello 42) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index f019977759..298f087e5d 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -196,7 +196,9 @@ bool configure_first_run_ui(const std::filesystem::path& package, std::filesyste {L"LEONIDA_D3D12", L"vulkan"}, {L"LEONIDA_ARENA_MB", L"2048"}, {L"LEONIDA_GRAPHICS_STAGE_LAYOUT", L"1"}, {L"LEONIDA_PIPELINE_COMPILE", L"on-demand"}, {L"LEONIDA_FRAME_PACING", L"1"}, - {L"LEONIDA_KEYBOARD_PAD", L"always"}, + // Focused, not always: keys typed into another window must not press anything on a consent page. + // Scripted presses (LEONIDA_INPUT_SCRIPT) still run while the window is unfocused. + {L"LEONIDA_KEYBOARD_PAD", L"1"}, }; for (const auto& setting : settings) { if (!set_default(setting.name, setting.value)) return false; diff --git a/runtime/test/fixtures/tiny_game.cpp b/runtime/test/fixtures/tiny_game.cpp index 21feaad5f5..69a696d30a 100644 --- a/runtime/test/fixtures/tiny_game.cpp +++ b/runtime/test/fixtures/tiny_game.cpp @@ -120,6 +120,7 @@ int main(int argc, char** argv) { }; check(configured("LEONIDA_D3D12", "vulkan"), "first-run UI Vulkan backend"); check(configured("LEONIDA_PIPELINE_COMPILE", "on-demand"), "first-run UI pipeline profile"); + check(configured("LEONIDA_KEYBOARD_PAD", "1"), "first-run UI keyboard pad reads keys only with focus"); check(configured("LEONIDA_ARENA_MB", "768"), "first-run UI caller override"); }