

I don't know any way except to see what modifiers are on in th
Keypress event.  Of course if there is some reason why you need to
always know the state of modifiers even if your windows don't have the
keyborads focus you can always ask for KeyPress events from the root
window.  Then you get all the KeyPresses and you always know what have
been pressed.


I think this is just a question of how to implement XLookupString.
You can always write another function that interprets the KeyPresses
as you like.  You can look at the implementation of XLookupString from
the Xlib sources and then modify it a little bit.