mirror of
https://github.com/encounter/SDL.git
synced 2025-12-16 08:27:05 +00:00
wayland: Handle virtual keyboards that don't fit the X mapping
SDL is built around the concept of keyboards having a fixed layout with scancodes that correspond to physical keys no matter what linguistic layout is used. Virtual keyboards don't have this concept and can present an arbitrary layout of keys with arbitrary scancodes and names, which don't fit the SDL model. When one of these keyboards is encountered, it requires special handling: use the keysym of the pressed keys to derive their ANSI keyboard scancode equivalents for control keys and ASCII characters. All other characters are passed through as text events only.
This commit is contained in:
committed by
Sam Lantinga
parent
d1858eb124
commit
c855184765
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "SDL_scancode.h"
|
||||
|
||||
/* This function only correctly maps letters and numbers for keyboards in US QWERTY layout */
|
||||
extern SDL_Scancode SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode);
|
||||
|
||||
#endif /* SDL_keysym_to_scancode_c_h_ */
|
||||
|
||||
Reference in New Issue
Block a user