8000 zdxsv: USB keyboard sends the physical key (Japanese keyboard layout) by inada-s-ai[bot] · Pull Request #552 · inada-s/pcsx2 · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@inada-s-ai
@inada-s-ai inada-s-ai Bot commented Nov 9, 2026
Copy link
Copy Markdown

Description of Changes

The host key event's native scan code goes along with the key to the CPU thread (KeyboardHooks.h). On Windows, the HID keyboard (hidkbd) sends that physical key (PS/2 set 1 number) to the game, not the key looked up by its character name. Without a scan code (other platforms, Pause), the name lookup stays.

Rationale behind Changes

For #551. Qt names a key by the character the host layout gives it. The game reads a Japanese layout. So on a Japanese keyboard @, :, ^ (Qt At, Colon, AsciiCircum) had no USB key and were dropped, and shifted keys were remapped by the US shift table. This also fixes upstream code: upstream hidkbd behaves the same. A US layout gives the same keys as before, so there is no setting to turn this off.

Suggested Testing Steps

  • Verified on windows-mini (Japanese layout, private rig, this branch's code): in a lobby room, typing @ : ^ A then Enter twice. The lobby echo is @:^あ. Control (the same build with HostKeyNumber returning 0): あ only. Shift+7 gave ’.
  • Not checked: Linux and macOS (no change there), real hardware keyboards (the rig sends keybd_event with scan codes), ¥ / ろ / _ / " (the game's chat character set does not seem to have them, so they did not show up).

Did you use AI to help find, test, or implement this issue or feature?

Yes. Claude Code found the cause, wrote the change and ran the rig.

🤖 Generated with Claude Code

…pes as one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
< 8000 /div>
@inada-s-ai
inada-s-ai Bot enabled auto-merge November 9, 2026 20:16
@inada-s-ai
inada-s-ai Bot merged commit 53bfc11 into zdxsv-master Nov 9, 2026
1 check passed
@inada-s-ai
inada-s-ai Bot deleted the ai/usb-kbd-scancode branch November 9, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

0