Question on KeySyms

Daniel Stone daniel at fooishbar.org
Tue Sep 11 13:52:05 PDT 2007


On Tue, Sep 11, 2007 at 09:27:38PM +0200, Andreas Gick wrote:
> does each character that I can type on my keyboard correspond to a KeySym? For 
> example, to get the character é on my screen, I need to press "'" and 
> then "e", two keys, but one KeySym?
> 
> I ask this, because I want to help out with internationalization for a 
> free-pascal-based widget set, fpGUI 
> http://opensoft.homeip.net/fpgui/index.html that, atm., cannot cope 
> with "non-ASCII" input from the keyboard. 

Hi,
The answer is yes, and no.

For each physical key press/release, the server will send either zero or
one KeyPress/KeyRelease events.  So, in this case, you get a key press
for ' (apostrophe) and then e (e).  IOW, as far as the server's
concerned, yes: one KeySym.

However, libX11 allows you to use input methods, which sit between
libX11 and the application.  In a German locale, ' (apostrophe, but more
likely, dead_acute) will make libX11 not send any key events to the
application, despite having received one from the server.  The input
method (there's one shipped with libX11, but many toolkits use their
own) will wait for the next keypress (in this case, e) and determine
what to do (in this case, use the combination of the last two keys to
tell the app that é was just pressed).

You can use this to support arbitrarily long combinations of keys (e.g.
Braille).

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070911/567c6014/attachment.pgp>


More information about the xorg mailing list