[PR #3774] [MERGED] Input: one player owns the keyboard, mouse and pointer (splitscreen groundwork) #5209

Closed
opened 2026-11-03 05:10:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3774
Author: @martipops
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: split/04-pointer-ownership


📝 Commits (1)

  • dd74144 Input: pointer ownership and view offset per player

📊 Changes

3 files changed (+64 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+27 -3)
📝 crates/horizon-client/src/game/pad_menu.rs (+4 -0)
📝 tests/test_world_input_capture.py (+33 -0)

📄 Description

🤖 Opened by martipops's AI agent (Claude), not by martipops themselves.

Blocked by: none (independent)

What and why

Part of the splitscreen series (#3541; parts so far: #3726 compositor, #3727 audio). Splitscreen
runs one Game per player in one process, and winit merges every keyboard and mouse into one
stream, so one player at a time owns the keyboard, the mouse and the native pointer. This adds
that ownership to Game, with no behaviour change on its own:

  • keyboard_mouse (default true): a game without it never grabs, frees, warps or shows/hides
    the window's pointer, and never sets its cursor icon.
  • view_at (default [0, 0]): the corner of this player's view in a shared window; the warp
    to the centre on capture includes it.
  • physical_buttons: the mouse buttons held, cleared on focus loss, so the next part can release
    them when keyboard and mouse move to another player.

With the defaults, single-player input is exactly as before. #3777 (a second player in the same window) is what sets these fields.

Suggested label: skip-release.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on Mac, against upstream/main at 9c15e18c6, 59 s)

Check Result
Scope ✅ 3 files, +64 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (34 s)
rustfmt ✅ (10 s)
clippy ✅ (3 s)
tests: horizon-client ✅ 831 passed (8 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

tests/test_world_input_capture.py gains two cases: a game without keyboard and mouse leaves the
pointer alone (no grab, warp or visibility change), and the owner's warp includes its view's offset.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3774 **Author:** [@martipops](https://github.com/martipops) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `split/04-pointer-ownership` --- ### 📝 Commits (1) - [`dd74144`](https://github.com/horizon-rust/horizon/commit/dd7414486b993f214cd1f4abe83d06bf5da57ec0) Input: pointer ownership and view offset per player ### 📊 Changes **3 files changed** (+64 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+27 -3) 📝 `crates/horizon-client/src/game/pad_menu.rs` (+4 -0) 📝 `tests/test_world_input_capture.py` (+33 -0) </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Claude), not by martipops themselves. **Blocked by:** none (independent) ## What and why Part of the splitscreen series (#3541; parts so far: #3726 compositor, #3727 audio). Splitscreen runs one `Game` per player in one process, and winit merges every keyboard and mouse into one stream, so one player at a time owns the keyboard, the mouse and the native pointer. This adds that ownership to `Game`, with no behaviour change on its own: - `keyboard_mouse` (default `true`): a game without it never grabs, frees, warps or shows/hides the window's pointer, and never sets its cursor icon. - `view_at` (default `[0, 0]`): the corner of this player's view in a shared window; the warp to the centre on capture includes it. - `physical_buttons`: the mouse buttons held, cleared on focus loss, so the next part can release them when keyboard and mouse move to another player. With the defaults, single-player input is exactly as before. #3777 (a second player in the same window) is what sets these fields. Suggested label: `skip-release`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Mac, against upstream/main at 9c15e18c6, 59 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +64 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (34 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (3 s) | | tests: horizon-client | ✅ 831 passed (8 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | `tests/test_world_input_capture.py` gains two cases: a game without keyboard and mouse leaves the pointer alone (no grab, warp or visibility change), and the owner's warp includes its view's offset. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:58 +07:00
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5209
No description provided.