1

This is actually a coding question.

I know that the X server checks the active keyboard layout to figure out which character (supporting unicode) to emit. But I don't actually know how this is done, could someone point me to the source code where I can see this in action?

What I want to actually do is to create a "unicode keyboard driver" which can do the same thing (ignoring the active layout), but then I need to know how X is emitting the unicode character to the GUI.

Even if I need to add new functionality to the X server and recompile it that's okay. I just want to be pointed to the right source code for emitting those characters into the GUI.

EDIT:

The comments pushed me in good directions on where to find answers. I think I've now figured out how I can programmatically output unicode text into GUI's on Linux.

Hints: xdotool / libxdo, XTestFakeKeyEvent, xmodmap -e "keycode 107 = U2196"

I will see if I can eventually answer this question with my own C++ library to do this.

1 Answers1

0

I figured out the two commands needed to do this programmatically:

XChangeKeyboardMapping (to map an unused keycode to char/unicode)

XTestFakeKeyEvent (to send it to the X server)

Hence any char can be sent and the keyboard layout can stay the same.