International keyboard layouts on Linux/SDL/Xwayland [solved]
Moderators: Cat_7, Ronald P. Regensburg
International keyboard layouts on Linux/SDL/Xwayland [solved]
Hello,
is there a keycodes file to use international keyboards (with german umlauts for example) on Linux/SDL/Xwayland?
If i activate the bundled sdl keycodes file bundled with the sources (https://github.com/kanjitalk755/macemu) the whole keyboard is messed up. if i dont activate the keycodes file i don't have the chance to use (in my case) german umlauts on my system
is there a keycodes file to use international keyboards (with german umlauts for example) on Linux/SDL/Xwayland?
If i activate the bundled sdl keycodes file bundled with the sources (https://github.com/kanjitalk755/macemu) the whole keyboard is messed up. if i dont activate the keycodes file i don't have the chance to use (in my case) german umlauts on my system
Last edited by scops on Sat Sep 04, 2021 2:04 pm, edited 1 time in total.
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland
I do not know which keycodes file is bundled with the source on kanjitalk755 (I cannot find it) but it is probably an old one that only works with SDL1 builds.
Also, the keycodes files distributed on this site do not yet work with SDL2 Linux builds.
Assuming that you use an ISO keyboard (with Return key shaped as a "L" upside-down), that your BasiliskII is built with SDL2, and that you chose the German layout in Keyboard control panel in MacOS in BasiliskII, this test keycodes file should work: https://ronaldpr.home.xs4all.nl/keycode ... s_test.zip
Also, the keycodes files distributed on this site do not yet work with SDL2 Linux builds.
Assuming that you use an ISO keyboard (with Return key shaped as a "L" upside-down), that your BasiliskII is built with SDL2, and that you chose the German layout in Keyboard control panel in MacOS in BasiliskII, this test keycodes file should work: https://ronaldpr.home.xs4all.nl/keycode ... s_test.zip
Re: International keyboard layouts on Linux/SDL/Xwayland
This file seems to be corrupt;
nothing more in this.
in general i tryed all keycodes i found here the german macOS version works nicely on macos but the keycodes doesn't match for Linux/SDL.
Maybe i can create a own keycodes file... have you some hints how to check which codes of sdl2 stands for which key and how i can see which code generates a keypress?
Code: Select all
#
# cocoa (SDL2)
# sdl x11
#
sdl cocoa
53 10 # `
in general i tryed all keycodes i found here the german macOS version works nicely on macos but the keycodes doesn't match for Linux/SDL.
Maybe i can create a own keycodes file... have you some hints how to check which codes of sdl2 stands for which key and how i can see which code generates a keypress?
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland
No, It is exactly only this.
Do you use a German ISO keyboard? And did you choose the German keyboard layout in Keyboard control panel in MacOS in BasiliskII?
In fact, with a SDL2 build you will need to correct in keycodes only one key for an ISO keyboard, the top-left key next to the number "1" key. Even without a keycodes file, all other keys should be there as expected. With the German keyboard layout selected, you can use a QWERTZ keyboard with, for instance, next to the "L" the ö ä and #.
Do you use a German ISO keyboard? And did you choose the German keyboard layout in Keyboard control panel in MacOS in BasiliskII?
In fact, with a SDL2 build you will need to correct in keycodes only one key for an ISO keyboard, the top-left key next to the number "1" key. Even without a keycodes file, all other keys should be there as expected. With the German keyboard layout selected, you can use a QWERTZ keyboard with, for instance, next to the "L" the ö ä and #.
Re: International keyboard layouts on Linux/SDL/Xwayland
Yes, i use a small german iso keyboard; keyboardtype 3 matches best. In (german) Mac OS 8 it is also selected.
y/z are still transposed and äöü can't be typed. if i type "-" (on the bottom right next to shift on my keyboard) "ß" apears on the screen..
edit:
i added "sdl x11" to the keycodes file so that Basilisk II can use it.
y/z are still transposed and äöü can't be typed. if i type "-" (on the bottom right next to shift on my keyboard) "ß" apears on the screen..
edit:
i added "sdl x11" to the keycodes file so that Basilisk II can use it.
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland
When you install an English MacOS, the keyboard defaults to an English keyboard. But the Keyboard control panel in MacOS should give a choice of different language keyboards. Isn’t the German keyboard among the choices?
Re: International keyboard layouts on Linux/SDL/Xwayland
Yes, and is selected (as only active keyboard) on Mac OS 8
edit:
here is a shot of my little setup. i just typed on the keyboard:
"qwertzuiopü+asdfghjklöä#<yxcvbnm,."
edit:
here is a shot of my little setup. i just typed on the keyboard:
"qwertzuiopü+asdfghjklöä#<yxcvbnm,."
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland
So what exactly is the problem? Keys appear correct in the Key Caps (Tastatur) application, but typing on the physical keyboard does not produce the correct characters?
Is your BasiliskII built with SDL2? If so, it should work correctly even without keycodes file, except for one key.
You could try this full keycodes file, but it should not be needed: https://ronaldpr.home.xs4all.nl/keycode ... ycodes.zip
(Option and Command keys may appear reversed in this file, depending on your "swap_opt_cmd" setting.)
(Yes, I did not correctly add "sdl x11" to the smaller file, I was in a hurry.)
Is your BasiliskII built with SDL2? If so, it should work correctly even without keycodes file, except for one key.
You could try this full keycodes file, but it should not be needed: https://ronaldpr.home.xs4all.nl/keycode ... ycodes.zip
(Option and Command keys may appear reversed in this file, depending on your "swap_opt_cmd" setting.)
(Yes, I did not correctly add "sdl x11" to the smaller file, I was in a hurry.)
Re: International keyboard layouts on Linux/SDL/Xwayland
Yes, the inputs where interpreted as if i had a english keyboard and not a german with the small keyfile
The complete file works! - i just copy/pasted the sdl x11 stuff.
The complete file works! - i just copy/pasted the sdl x11 stuff.
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland
Now I am left wondering why the smaller file did not work. Unlike pre-SDL2 builds, BasiliskII (and SheepShaver) built with SDL2 should do most scancode to keycode translations by itself. That was made possible because with SDL2 the scancodes are identical on all platforms. It works like that in macOS and Windows builds. Only the one key that behaves differently on ISO vs ANSI keyboards should need translation in the keycodes file.
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland [solved]
Maybe you can help me to understand how this works in your BasiliskII build.
Your BasiliskII was built from recent kanjitalk755 source with SDL2 2.0.14 or later?
If you do not use a keycodes file, that is if in the prefs file is set does not typing work as expected with the exception of the key left to the "1" key?
Note that if keycodes is set to true while no keycodes file is selected, BasiliskII will look for an available keycodes file and use that one.
Your BasiliskII was built from recent kanjitalk755 source with SDL2 2.0.14 or later?
If you do not use a keycodes file, that is if in the prefs file is set
Code: Select all
keycodes false
Note that if keycodes is set to true while no keycodes file is selected, BasiliskII will look for an available keycodes file and use that one.
Re: International keyboard layouts on Linux/SDL/Xwayland [solved]
yes, i compiled with the how to found on the wiki with the SDL2 2.0.14 package on debian bullseye.Ronald P. Regensburg wrote: ↑Sat Sep 04, 2021 3:40 pm Maybe you can help me to understand how this works in your BasiliskII build.
Your BasiliskII was built from recent kanjitalk755 source with SDL2 2.0.14 or later?
if i turn off the keycodes completly the key left to "1" does just nothing.Ronald P. Regensburg wrote: ↑Sat Sep 04, 2021 3:40 pm If you do not use a keycodes file, that is if in the prefs file is setdoes not typing work as expected with the exception of the key left to the "1" key?Code: Select all
keycodes false
i set it manually with keycodefile [filename]Ronald P. Regensburg wrote: ↑Sat Sep 04, 2021 3:40 pm Note that if keycodes is set to true while no keycodes file is selected, BasiliskII will look for an available keycodes file and use that one.
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland [solved]
no; if i disable the keycodes follow errors/missmatches appear:
- ^ does nothing
- ß does nothing
- ` (next to ß on my keyboard) does nothing
- < shows up as "m" but makes a ","
- - makes a "ß"
- # "makes a "3"
- äöü does nothing
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland [solved]
Well, this is not what I expected and not what happens in OSX/macOS versions and afaik in Windows versions. I will try to figure this out and maybe discuss it with kanjitalk755.
Thanks for the test.
Thanks for the test.
Re: International keyboard layouts on Linux/SDL/Xwayland [solved]
you are welcome
If you or kanjitalk755 have patches to test, feel free to contact me directly (github.com/codeandcreate).
maybe it has something todo with SDL on X on wayland? I haven't tried it on xorg directly - i use gnome 40 on wayland.
If you or kanjitalk755 have patches to test, feel free to contact me directly (github.com/codeandcreate).
maybe it has something todo with SDL on X on wayland? I haven't tried it on xorg directly - i use gnome 40 on wayland.
no RISC no FUN
- Ronald P. Regensburg
- Expert User
- Posts: 7832
- Joined: Thu Feb 09, 2006 10:24 pm
- Location: Amsterdam, Netherlands
Re: International keyboard layouts on Linux/SDL/Xwayland [solved]
Thanks, I will remember you for testing.
In SDL2 builds, unlike in pre-SDL2 builds, scancodes are identical on all three platforms and thus SDL2 scancode to Mac keycode translations are identical. Basically, the keycodes file can be the same for all platforms. This is also true for the Linux version, otherwise the keycodes file would not work correctly.
In SDL2 builds for OSX/macOS those translations are built-in in the application. With ANSI (and similar) keyboards no keycodes file is needed, regardless the language layout. Only for ISO and ABNT (Brazilian) keyboards a keycodes file is needed for the one key that behaves differently on those keyboards (the key left of the "1" key).
I thought it was the same in SDL2 builds for Windows (apart from an issue with the Windows logo key), I will need to check that.
Apparently it is not the same in Linux builds.
In SDL2 builds, unlike in pre-SDL2 builds, scancodes are identical on all three platforms and thus SDL2 scancode to Mac keycode translations are identical. Basically, the keycodes file can be the same for all platforms. This is also true for the Linux version, otherwise the keycodes file would not work correctly.
In SDL2 builds for OSX/macOS those translations are built-in in the application. With ANSI (and similar) keyboards no keycodes file is needed, regardless the language layout. Only for ISO and ABNT (Brazilian) keyboards a keycodes file is needed for the one key that behaves differently on those keyboards (the key left of the "1" key).
I thought it was the same in SDL2 builds for Windows (apart from an issue with the Windows logo key), I will need to check that.
Apparently it is not the same in Linux builds.