Repository navigation
Fix Hankaku/Zenkaku key handling on Windows Japanese keyboard layouts - #2109
Open
hinatamaxxx wants to merge 1 commit into
Open
hinatamaxxx wants to merge 1 commit into
hinatamaxxx wants to merge 1 commit into
Conversation
Member
|
Is SDL3 handling this situation properly? If we're having to invoke native OS APIs to determine what to do with a keypress, it seems like it's not. It also looks like the Hankaku/Zenkaku key is supposed to be SDL_SCANCODE_LANG5 not |
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.
Problem
On Windows with a Japanese keyboard layout, holding down the Hankaku/Zenkaku key (
SDL_SCANCODE_GRAVE, scan code0x29) causes the host's IME to toggle rapidly and continuously.Root Cause
On Windows Japanese keyboard layouts (
LANG_JAPANESE), the Hankaku/Zenkaku key reports its physical press asWM_KEYUP(SDL_RELEASED) and its physical release asWM_KEYDOWN(SDL_PRESSED).WM_KEYUP(SDL_RELEASED) events withoutevent->repeatset, bypassing Moonlight'sif (event->repeat) return;filter.Fix
LANG_JAPANESE, handleSDL_SCANCODE_GRAVEas a single complete tap (KEY_ACTION_DOWNfollowed immediately byKEY_ACTION_UP) on the firstSDL_RELEASED.m_HankakuZenkakuHeldso subsequent auto-repeatedSDL_RELEASEDevents are ignored untilSDL_PRESSED(physical release) orraiseAllKeys()(focus loss / ungrab).Testing
Tested on Windows 11 client (Japanese JIS keyboard, Microsoft IME) streaming to a Windows 11 host (Sunshine):
Alt+Tab) properly resets held state viaraiseAllKeys().