Conversation
Modern xpad hardcodes XPAD_PKT_LEN = 64 for all incoming interrupt URBs to accommodate Xbox One controllers. However, Xbox 360 and classic Xbox devices communicate using 32-byte frames (wMaxPacketSize = 32). On USB endpoints that emit 32-byte reports without Zero-Length Packets (such as high-polling composite devices), requesting 64 bytes causes the host controller to defer URB completion until two 32-byte packets accumulate. This leads to paired/lagged inputs and unreleased button states while stationary. Separate the buffer allocation size (kept at 64 bytes for DMA safety) from the transfer buffer length, setting in_len to 32 bytes for non-Xbox-One devices. Signed-off-by: Thomaz Reis <thor27@gmail.com>
thor27
force-pushed
the
fix-x360-packet-len-and-keychron
branch
from
September 13, 2026 22:30
88e0acf to
6a976cd
Compare
Add VID 0x3434 and PID 0x1030 for the Keychron Q3 HE 8K keyboard running in Xbox gamepad emulation mode. Signed-off-by: Thomaz Reis <thor27@gmail.com>
thor27
force-pushed
the
fix-x360-packet-len-and-keychron
branch
from
September 13, 2026 22:32
6a976cd to
cd692ea
Compare
thor27
marked this pull request as ready for review
September 13, 2026 22:54
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.
Fix: #374
Add support for Keychron keyboards running in Xbox gamepad emulation mode.
Besides adding the id support, to get proper button working, we also need to change the packet size to 32bits.
I think 64bits package, as per git history, is only for Xbox One controller, so this fix should improve compatibility with previous and older non standard controller:
I used Gemini to help me identify the problem and write commit messages.
Testing and coding was done by me.