Skip to content

A raw HID pad GameController only promised takes a player at its first button press: a Keychron Link no longer takes player 1 (#1657) - #1685

Closed
AntoineBRTL wants to merge 1 commit into
seedds:mainfrom
AntoineBRTL:fix/hid-receiver-takes-player-1
Closed

AntoineBRTL wants to merge 1 commit into
seedds:mainfrom
AntoineBRTL:fix/hid-receiver-takes-player-1

Conversation

@AntoineBRTL

@AntoineBRTL AntoineBRTL commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1657

A raw HID device that GameController says it supports (supportsHIDDevice: YES) but never lists now takes a player only at its first button press, instead of right after HIDPAD_GC_WAIT. A keyboard and mouse receiver that declares a GamePad collection (Keychron Link, 3434:d030) sends no buttons, so it no longer takes player 1 from the real controller. A real pad on that path (8BitDo Ultimate 2C, #965) joins on its first press. If its GCController connects meanwhile, it goes to GameController as before.

Only dm/host/pad_hid_mac.h changes.

Testing

…t button press: a Keychron Link no longer takes player 1 (seedds#1657)

Since PR seedds#859, a device +[GCController supportsHIDDevice:] answers YES for
but GameController never lists is read as HID after HIDPAD_GC_WAIT. A
keyboard and mouse receiver that declares a GamePad or Joystick collection
(Keychron Link, 3434:d030) takes that path, becomes player 1 and pushes the
real controller to player 2, so a one-player game such as Ocarina of Time
reads nothing.

After the wait, such a device now stays in g_hidpads_waiting (idle) and
becomes a player only at its first button press (hidpad_value_idle). A
receiver sends no buttons, so it never takes a slot; a real pad such as the
8BitDo Ultimate 2C (seedds#965) joins on its first press. An idle device whose
GCController connects later goes to GameController (hidpad_gc_connected).

Checked: clang -fsyntax-only on pad_hid_mac.h. Not run on hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the host The Horizon host: SVCs, services, threads, memory (dm/host) label Nov 7, 2026
seedds added a commit that referenced this pull request Nov 11, 2026
…oard receiver that declares a gamepad no longer takes player 1: a Keychron Link receiver (3434:d030) declares a Generic Desktop GamePad or Joystick collection, +[GCController supportsHIDDevice:] answers YES for it and GameController never lists it, so since 463d21f it was read as HID after the two-second wait and took the lowest free player at once; the Pro Controller became player 2 and a one-player game (Ocarina of Time) took no input from it. A HID descriptor only claims a controller, and nothing in it tells a receiver that never sends a report through that collection from a pad at rest, so every raw HID pad (hinted by GameController or not) now takes its player at its first button press (hidpad_first_press, front_mac.m), through the path of Press a button to join but with the slot a connecting controller takes (pad_slot_take); the joining press reaches the game. Identical pads read from IOKit (twins) stay players at their connection, and DM_PAD_MERGE is unchanged. The host builds and the host tests and test_docs pass; not run with such a receiver or any raw HID pad, so the issue stays open for the reporter's retest. The controller applet opening in a loop when a one-player game sees two players is a cause of its own (issue #2237). The first-press approach is PR #1685's, rebuilt on the existing join path for every raw HID pad (issue #1657, PR #1685)

Co-authored-by: Antoine Bartoli <59134956+AntoineBRTL@users.noreply.github.com>
@seedds

seedds commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Thanks for this. The idea here (a player only at the first button press) is what landed, in f20f650, with you credited as co-author.

It was rebuilt rather than merged, for three reasons:

  • The host already has a first-press path for raw HID pads (Press a button to join, hidpad_read / hidpad_attach in front_mac.m). The fix uses that path instead of a second idle state in g_hidpads_waiting, so the controller prompt and the hand-back to GameController work without new code.
  • It applies to every raw HID pad, not only those supportsHIDDevice: answers YES for: a silent device GameController says NO for took player 1 by the same path.
  • The joining press now reaches the game, as the docs say it does.

Closing in favour of that commit. #1657 stays open until the reporter retests with the receiver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

host The Horizon host: SVCs, services, threads, memory (dm/host)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mac: a keyboard receiver (Keychron Link) becomes player 1 as a raw HID pad since PR #859

2 participants