Howto handle modified keys

Thomas Dickey dickey at radix.net
Fri Oct 20 06:21:31 PDT 2006


On Fri, Oct 20, 2006 at 02:09:35PM +0100, Glynn Clements wrote:
> The Control, Shift and Lock modifiers are associated with specific
> modifier bits.

See X.h, e.g.,

#define ShiftMask		(1<<0)
 
> For other modifiers (Alt, Meta, Hyper, Super), the correct way to

X.h doesn't define modifiers for Alt, etc.

There are keysyms (see keysymdef.h) for keys which are not necessarily
treated as modifiers.

> identify modifier bits is to check which keysyms are associated with
> the modifier bits. E.g. if mod1 is associated with Alt_L and/or Alt_R,
> then mod1 is the Alt modifier. Use XGetModifierMapping and
> XGetKeyboardMapping to determine the mapping between modifier bits and
> keysyms.
> 
> Note that, historically, the key labelled Alt tended to correspond to
> the Meta modifier rather than the Alt modifier.

That's imprecise: something like "the modifier associated with the Meta
keysym" is closer.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20061020/4d9a5c3a/attachment.pgp>


More information about the xorg mailing list