I'm using Xlib for a project, and I'm trying to get the KeySym relative to a pressed key.
I've got the KeyCode relative to the pressed key, keyboard modifiers and keyboard indicators. I'm referring to this page to understand how to retrieve the correct key, but it must be out of date or something, because my X doesn't behave like that page says.
I've got some questions:
What is MODE SWITCH? How can I see what key is my MODE SWITCH and how can I set it? (via Xlib functions or via a command, it's the same).
That page says that the first 4 KeySyms associated to a KeyCode (found with
XGetKeyboardMapping
, or shown byxmodmap -pk
command) are divided into two groups. MODE SWITCH switches between groups, and within a group the first or the second KeySym is chosen according to modifiers (ie, shift key) or indicators (ie, caps lock). But on my X I can see that if shift is pressed, I switch to the third KeySym, not the second one.On many european layouts AltGr key is bound to KeySym
XS_ISO_Level3_Shift
, which doesn't belong to any keyboard modifier (ie,shift
,lock
,control
,mod1
,mod2
,mod3
,mod4
andmod5
). When suchXS_ISO_Level3_Shift
is pressed, the fifth KeySym associated to the KeyCode is chosen. Why? Where can I found some info about thisXS_ISO_Level3_Shift
and about other keysyms that are actually used, but not documented on Xlib manuals?
xdpyinfo | grep XKEYBOARD
to know if it is the case). Each time I've looked at that, I started confused and then understood. But I've never reached a state where I remembered the underlying logic of that mess. – AProgrammerxev
? This is often a quick and simple way to resolve problems. – Joseph Quinsey