Does anyone know how to detect the keyboard layout under linux???
C or C++ code please.
I know how to do this under windows. wxwidgets doesn't seem to have a function to help me.
I believe I need to use kbdd???
Well, on the command line:
setxkbmap -print | awk -F"+" '/xkb_symbols/ {print $2}'
so I'd look at the source for setxkbmap to see what it does?
Actually, the -query option might be better.
setxkbmap -query | grep layout
If you are detecting keyboard layout so in English you use (e.g.,) WASD and in French you use ZQSD, for example, you could have the startup script for the tool configure a settings file for the application with the correct key-codes?
Quote from: Sykobee (Briggsy) on 09:42, 15 October 13
setxkbmap -print | awk -F"+" '/xkb_symbols/ {print $2}'
setxkbmap works with X but does it work under the command line as well?
localectl
might work? It doesn't on X though, but it might in a plain text-mode console.
Quote from: Sykobee (Briggsy) on 12:43, 15 October 13
localectl
might work? It doesn't on X though, but it might in a plain text-mode console.
so many possibilities :(
On windows it is soo easy.
So I want to detect the keyboard language so I can configure my emulator automatically.
And then there's Wayland and Mir ... hopefully they use a compatible keyboard system to X so you don't need completely new tools there.
Really there should be an API to get this information. File a bug against wxWindows :p