Skip to content

Use SDL_GetKeyFromScancode instead of SDL_EVENT_TEXT_INPUT for keychar#2887

Open
riccardobl wants to merge 4 commits into
jMonkeyEngine:masterfrom
riccardobl:machint
Open

Use SDL_GetKeyFromScancode instead of SDL_EVENT_TEXT_INPUT for keychar#2887
riccardobl wants to merge 4 commits into
jMonkeyEngine:masterfrom
riccardobl:machint

Conversation

@riccardobl

@riccardobl riccardobl commented Jun 22, 2026

Copy link
Copy Markdown
Member

SDL_StartTextInput starts the IME in some environments (eg. macOs or KDE6+) making the engine behavior undefined, some IMEs might open little popups (eg. for accent selection), some might just consume the inputs entirely.

This PR fixes the issue by making the engine use SDL_GetKeyFromScancode instead of SDL_EVENT_TEXT_INPUT from SDL_StartTextInput .

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a call to SDL_SetHint(SDL_HINT_MAC_PRESS_AND_HOLD, "0") in LwjglWindow.java before initializing the SDL subsystem. This change disables the macOS "press and hold" feature for character accents, allowing standard key repeat behavior. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@riccardobl riccardobl changed the title Disable mac os press and hold behavior Use SDL_GetKeyFromScancode instead of SDL_EVENT_TEXT_INPUT for keychar Jun 23, 2026
@riccardobl

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors keyboard input handling in SdlKeyInput.java by removing SDL text input event handling (SDL_StartTextInput, SDL_StopTextInput, and SDL_EVENT_TEXT_INPUT). Instead, it now resolves key characters directly from scancodes and modifiers using SDL_GetKeyFromScancode during standard key events. There are no review comments, so I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant