action #133613
openSupport for passing non-US-keyboard letters to the 'type_string' function size:M
0%
Description
Motivation¶
The backend process dies after passing russian language characters to the 'type_string' function, see #133319
Acceptance criteria¶
- AC1: os-autoinst provides explicit feedback about language support, either proper unicode support
- AC2: #133319 is resolved
Suggestions¶
- Read how https://github.com/os-autoinst/os-autoinst/tree/master/consoles/VNC.pm currently works
- Read qemu docs about emulated keyboards because that is what is important for what we need to pass to the test systems
- Of course don't add support for individual characters. Try to provide a generic support (or "more generic"). If not possible then at least provide a clear error message what encodings or what keyboard keys are supported
- If no better solution is found fall back to plain old try/catch and "unknown letter" error message
- Check pending PRs for extending support for other keyboard layouts
Updated by okurz over 1 year ago
- Copied from action #133451: Backend dies when passing non-US-keyboard letters to the 'type_string' function size:M added
Updated by livdywan over 1 year ago
Just to retain the research that was already done:
A live X11 server can map keys to unicode. Of course openQA doesn't introspect the SUT. However 1) these could be generated via a reference server 2) mappings could be generated from config files. That could be done as part of the build or even as a "generate key mapping for layout" function in the testapi.
https://github.com/os-autoinst/os-autoinst/blob/master/consoles/VNC.pm
https://metacpan.org/pod/X11::Xlib#char_to_keysym
https://metacpan.org/pod/X11::Xlib::Keymap#find_keycode
https://metacpan.org/pod/X11::Xlib#codepoint_to_keysym
https://metacpan.org/dist/X11-Xlib/source/lib/X11/Xlib/Keymap.pm
Right now the code hard-codes a specific US keyboard layout. The generic solution needs to replace that with mappings based on a given layout specifier.