feat(libScePad): toggle mouse capture with F7 beside the middle button #7496

Merged
AlxcBTW merged 1 commit from upstream-pr/7496 into main 2026-10-18 20:21:58 +00:00
AlxcBTW commented 2026-10-18 09:35:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-18T09:35:37Z.


What

ToggleMouse (mouse capture, mouse as the right stick) is bound to the middle mouse button only. A mouse without a usable middle button, or a laptop touchpad, cannot capture the mouse unless the player writes an anyps5-input.ini first.

This adds F7 as a second built-in ToggleMouse binding. It needs no setting: a ToggleMouse = ... line in anyps5-input.ini replaces both built-in bindings as before, and F7 goes with it. F7 is the key shadPS4 uses for the same toggle. F10 is avoided because Windows treats it as the menu key. Nothing else changes: the request path in Pad::KeyboardMouse::HandleEvent already handles a key bound to ToggleMouse.

docs/user/INPUT_MAPPING.md lists F7 in the default bindings and in the mouse-capture section.

Tested

  • Linux (Ubuntu 24.04, GCC 13, Mesa lavapipe runner), fork CI at 6cf964c8d (the PR head 53af7be7e plus the CI scaffolding commit; run 39113757749, ctest -R '^(pad_|guest_pad|video_out_mouse|mouse_input|keyboard_input)'): 9 of 9 passed, among them pad_keyboard_mouse and pad_input_mapping. Not run on Windows.
  • New checks: pad_keyboard_mouse (F7 down asks to toggle the mouse, F7 up asks for nothing) and pad_input_mapping (F7 and the middle button are both default ToggleMouse bindings; a ToggleMouse = MOUSE:Right line leaves neither of them).
  • Not tested in a game with a real keyboard.
  • python3 tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py lists #6353 (InputMapping.hpp, the default-bindings array, a different line) and could not compare #674 and #4891 (both touch docs/user/INPUT_MAPPING.md, #4891 also InputMapping.hpp); none changes ToggleMouse bindings. Based on cdb7ed035.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4908009398 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7496). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-18T09:35:37Z. --- ### What `ToggleMouse` (mouse capture, mouse as the right stick) is bound to the middle mouse button only. A mouse without a usable middle button, or a laptop touchpad, cannot capture the mouse unless the player writes an `anyps5-input.ini` first. This adds `F7` as a second built-in `ToggleMouse` binding. It needs no setting: a `ToggleMouse = ...` line in `anyps5-input.ini` replaces both built-in bindings as before, and F7 goes with it. F7 is the key shadPS4 uses for the same toggle. F10 is avoided because Windows treats it as the menu key. Nothing else changes: the request path in `Pad::KeyboardMouse::HandleEvent` already handles a key bound to `ToggleMouse`. `docs/user/INPUT_MAPPING.md` lists F7 in the default bindings and in the mouse-capture section. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Linux (Ubuntu 24.04, GCC 13, Mesa lavapipe runner), fork CI at 6cf964c8d (the PR head 53af7be7e plus the CI scaffolding commit; run 39113757749, ctest `-R '^(pad_|guest_pad|video_out_mouse|mouse_input|keyboard_input)'`): 9 of 9 passed, among them `pad_keyboard_mouse` and `pad_input_mapping`. Not run on Windows. - New checks: `pad_keyboard_mouse` (F7 down asks to toggle the mouse, F7 up asks for nothing) and `pad_input_mapping` (F7 and the middle button are both default `ToggleMouse` bindings; a `ToggleMouse = MOUSE:Right` line leaves neither of them). - Not tested in a game with a real keyboard. - `python3 tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py` lists #6353 (`InputMapping.hpp`, the default-bindings array, a different line) and could not compare #674 and #4891 (both touch `docs/user/INPUT_MAPPING.md`, #4891 also `InputMapping.hpp`); none changes `ToggleMouse` bindings. Based on cdb7ed035. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-18 10:31:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T10:31:35Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 674 docs/user/INPUT_MAPPING.md
PR 4891 core/libs/prx/libScePad/include/InputMapping.hpp
docs/user/INPUT_MAPPING.md
PR 6353 core/libs/prx/libScePad/include/InputMapping.hpp
core/libs/prx/libSceVideoOut/tests/KeyboardMouse.cpp
docs/user/INPUT_MAPPING.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6248784349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7496#issuecomment-6248784349). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T10:31:35Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 674](https://www.github.com/boykopovar/AnyPS5/pull/674) | `docs/user/INPUT_MAPPING.md` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libScePad/include/InputMapping.hpp`<br>`docs/user/INPUT_MAPPING.md` | | [PR 6353](https://www.github.com/boykopovar/AnyPS5/pull/6353) | `core/libs/prx/libScePad/include/InputMapping.hpp`<br>`core/libs/prx/libSceVideoOut/tests/KeyboardMouse.cpp`<br>`docs/user/INPUT_MAPPING.md` |
LeandroLP23 commented 2026-10-18 16:44:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T16:44:32Z.


Windows run, since the description lists Windows as not run. Windows 11 26300, Ryzen AI 7 350, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Build: main 6efb7261b with #6648, #7559, #7496, #7497 and #7498 merged together (each merge clean, built once).

pad_keyboard_mouse and pad_input_mapping pass 3 runs of 3. The output includes this PR's toggle requests line, so the new checks ran on Windows.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252461605 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7496#issuecomment-6252461605). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T16:44:32Z. --- Windows run, since the description lists Windows as not run. Windows 11 26300, Ryzen AI 7 350, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. Build: `main` `6efb7261b` with #6648, #7559, #7496, #7497 and #7498 merged together (each merge clean, built once). `pad_keyboard_mouse` and `pad_input_mapping` pass 3 runs of 3. The output includes this PR's `toggle requests` line, so the new checks ran on Windows. AI-assisted
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
boykopovar/AnyPS5!7496
No description provided.