Keysym to modifiers state

Jim Gettys jg at freedesktop.org
Wed Nov 2 05:51:30 PST 2005


How the list of keysyms and modifiers in an event gets mapped to a
particular keysym is a matter of convention and input method; I'm not up
on the exact details used under what circumstances, a lot of the I18N
work having gone on when I was doing things other than X.  This can get
quite complex for some languages, involving multiple key presses (e.g. 
many Asian languages).  So I don't have a simple answer for you.

Arguably, there should be some way in X to send (cognizant) clients a
unicode character: at the moment, there is not any I'm aware of, beyond
sending a keypress event having previously defined a keysym out of the
unicode part of the keysym address space.

Anyone else on the list have anything to help Cvetelin with?

Cvetelin, what *exactly* are you trying to achieve?  Understanding your
*goal* would help people help you, and it is very unlikely you are
trying to solve a problem that hasn't been solved before.  Just asking
how you do something in a preconceived fashion isn't very enlightening
to the mailing list.
				- Jim Gettys



On Wed, 2005-11-02 at 15:20 +0200, Cvetelin Andreev wrote:
> Tell me where to find some help for my problem please.
> 
> On Tue, 01 Nov 2005 14:51:10 +0200, Cvetelin Andreev  
> <cvetelin.a at komero.net> wrote:
> 
> > Hi all,
> >
> > After a week researching did not find some answers.
> >
> > I want to send a KeyEvent with XSendEvent with specified keysym. But the
> > KeyEvent structure requres keycode (which is system dependant) and
> > modifiers. I can obtain the keycode from the keysym with  
> > KKeysymToKeycode,
> > but what about modifiers?
> > A solution is to get the keycode, and to test this keycode with all
> > modifiers masks for equality with the original keysym with
> > XKeycodeToKeysym (or ewith constructing event with each modifiers
> > combination and test it with XLookupString). However the combinations of
> > modifiers are large number.
> >
> > So is there a way to get the modifiers state from the keysym?
> >
> 
> 
> 




More information about the xorg mailing list