New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windib returns locale dependent SDLK_ codes #95
Comments
sulix
added a commit
to sulix/sdl12-compat
that referenced
this issue
Nov 5, 2021
SDL 1.2 seems to only account for (non-en_US) keyboard layouts on some platforms and configurations. In particular, the KeySym may contain the translated key, or may contain a "scancode" which is layout-independent. In particular, on X11 the configured layout is used, but only (it seems) if it is the only configured layout. (On systems where multiple layouts are configured, the US layout is used regardless of the configured one.) Similarly, the windib backend deliberately forces the US layout in order to match the DirectX backend, which only provides scancodes. Since this behaviour is very inconsistant between different configurations, this patch provides a way of configuring which is used at runtime: If the SDL12COMPAT_USE_KEYBOARD_LAYOUT environment variable is set to a nonzero value, sdl12compat will translate keyboard input according to the current layout. This matches SDL 1.2 on X11 with only one configured layout. Otherwise (the default), sdl12compat will use SDL2 scancodes for keyboard input, essentially forcing all input to the US layout. This matches SDL 1.2 on Windows, and on X11 with multiple configured layouts. Regardless of the value of this environment variable, the 'unicode' value will be affected by keyboard layout. For discussion and more details see: - sdl12compat issue libsdl-org#135: Non-US Keyboard layouts not supported libsdl-org#135 - sdl12compat PR libsdl-org#97: Use Scancodes instead of Keycodes libsdl-org#97 - SDL 1.2 issue libsdl-org#95: windib returns locale dependent SDLK_ codes libsdl-org/SDL-1.2#95
sulix
added a commit
to sulix/sdl12-compat
that referenced
this issue
Nov 6, 2021
SDL 1.2 seems to only account for (non-en_US) keyboard layouts on some platforms and configurations. In particular, the KeySym may contain the translated key, or may contain a "scancode" which is layout-independent. In particular, on X11 the configured layout is used, but only (it seems) if it is the only configured layout. (On systems where multiple layouts are configured, the US layout is used regardless of the configured one.) Similarly, the windib backend deliberately forces the US layout in order to match the DirectX backend, which only provides scancodes. Since this behaviour is very inconsistant between different configurations, this patch provides a way of configuring which is used at runtime: If the SDL12COMPAT_USE_KEYBOARD_LAYOUT environment variable is set to a nonzero value, sdl12compat will translate keyboard input according to the current layout. This matches SDL 1.2 on X11 with only one configured layout. Otherwise (the default), sdl12compat will use SDL2 scancodes for keyboard input, essentially forcing all input to the US layout. This matches SDL 1.2 on Windows, and on X11 with multiple configured layouts. Regardless of the value of this environment variable, the 'unicode' value will be affected by keyboard layout. For discussion and more details see: - sdl12compat issue libsdl-org#135: Non-US Keyboard layouts not supported libsdl-org#135 - sdl12compat PR libsdl-org#97: Use Scancodes instead of Keycodes libsdl-org#97 - SDL 1.2 issue libsdl-org#95: windib returns locale dependent SDLK_ codes libsdl-org/SDL-1.2#95
slouken
pushed a commit
to libsdl-org/sdl12-compat
that referenced
this issue
Nov 6, 2021
SDL 1.2 seems to only account for (non-en_US) keyboard layouts on some platforms and configurations. In particular, the KeySym may contain the translated key, or may contain a "scancode" which is layout-independent. In particular, on X11 the configured layout is used, but only (it seems) if it is the only configured layout. (On systems where multiple layouts are configured, the US layout is used regardless of the configured one.) Similarly, the windib backend deliberately forces the US layout in order to match the DirectX backend, which only provides scancodes. Since this behaviour is very inconsistant between different configurations, this patch provides a way of configuring which is used at runtime: If the SDL12COMPAT_USE_KEYBOARD_LAYOUT environment variable is set to a nonzero value, sdl12compat will translate keyboard input according to the current layout. This matches SDL 1.2 on X11 with only one configured layout. Otherwise (the default), sdl12compat will use SDL2 scancodes for keyboard input, essentially forcing all input to the US layout. This matches SDL 1.2 on Windows, and on X11 with multiple configured layouts. Regardless of the value of this environment variable, the 'unicode' value will be affected by keyboard layout. For discussion and more details see: - sdl12compat issue #135: Non-US Keyboard layouts not supported #135 - sdl12compat PR #97: Use Scancodes instead of Keycodes #97 - SDL 1.2 issue #95: windib returns locale dependent SDLK_ codes libsdl-org/SDL-1.2#95
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Always uses US keymap to create VK_ virtual key codes (us-kb-map.txt, text/plain, 2006-03-14 15:49:25 +0000, 1413 bytes)Proposed patch for windib keyboard handling (windib-fixes.txt, text/plain, 2006-03-15 22:34:37 +0000, 5267 bytes)Reported in version: HG 1.2
Reported for operating system, platform: Windows (All), x86
Comments on the original bug report:
On 2006-03-14 13:37:19 +0000, John Popplewell wrote:
On 2006-03-14 15:49:25 +0000, John Popplewell wrote:
On 2006-03-15 06:17:02 +0000, John Popplewell wrote:
On 2006-03-15 06:29:41 +0000, John Popplewell wrote:
On 2006-03-15 22:34:37 +0000, John Popplewell wrote:
On 2006-03-16 05:25:31 +0000, John Popplewell wrote:
On 2006-03-16 08:22:39 +0000, John Popplewell wrote:
On 2006-05-17 23:24:17 +0000, Ryan C. Gordon wrote:
On 2006-06-24 00:39:33 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: