Skip to content
Advertisement

How to change Keyboard Layout (a X11 API solution)

I want to change keyboard layout in Linux by programming, What X11’s API function does this?

Advertisement

Answer

I found one good solution. It’s a c++ class wrriten by Jay Bromley, that I can add to my app and using it.

source code

It’s very easy to use:

JavaScript

you can read source code and found some another useful functions. for compiling standalone version you need to un-comments “int main” function present in “XKeyboard.cpp” (or write your own main.cpp) and use somethings like this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement