Repository navigation
Hardware input: per-game pointer lock for mouse-look from launch - #625
Open
alantangok wants to merge 1 commit into
Open
alantangok wants to merge 1 commit into
alantangok wants to merge 1 commit into
Conversation
First-person games on iPad need the pointer locked so the view keeps turning at the screen edges. Automatic lock waits for the game to hide its cursor, and the Relative toggle applies to every game. A game's own MADEIRA_POINTER_LOCK_ON_START=1 now starts that game in relative mouse-look with automatic pointer lock, without a hidden-cursor report. Focus loss and manual unlock still release it. Default off. Signed-off-by: alantangok <alantangok@gmail.com>
Contributor
Author
|
Tested on an iPad Air 5 (iPadOS 27.2) with a Magic Keyboard trackpad and Counter-Strike 1.6 in OpenGL (Zink), with
Marking ready for review. |
alantangok
marked this pull request as ready for review
November 17, 2026 09:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First-person games need the pointer locked so the view keeps turning at the screen edges. Today the automatic lock waits for the game to hide its cursor, and the Relative toggle is global.
This adds a per-game switch:
MADEIRA_POINTER_LOCK_ON_START=1in a game's own config starts that game in relative mouse-look with automatic pointer lock, without needing a hidden-cursor report. It reuses the existing Relative-mode path (cursorShownForRouteandupdateAutoLock), so focus loss, manual unlock (Ctrl+Alt+P) and the existing lock guards still apply. Default off; other games are unchanged.HardwareInput.swift:lockOnStart, read per launch likeMADEIRA_POINTER_HIDDEN_ABSOLUTEdocs/KEYBOARD_MOUSE.md: bullet and switch table rowConfigCatalog.generated.swift: the generator's row for the new keytests/host/check-pointer-capture.py: captures with the toggle off, stays captured while the game shows a cursor, releases on focus loss; unchanged behaviour without the switchChecks:
check-pointer-capture.pyandcheck-hardware-input.pypass. Not tested on a device yet. I'll try it with Counter-Strike 1.6 (OpenGL) on an iPad Air 5 and report back.