Howto handle modified keys

Glynn Clements glynn at gclements.plus.com
Fri Oct 20 07:48:05 PDT 2006


Philip Pflästerer wrote:

> > Look in the state field of the key event, there's Mod[1..4]Mask
> > available.  I think Alt is generally Mod4.  So a key press of f with
> > Mod4Mask in state, means Alt-F.
> 
> Alt is Mod4Mask. Mod3Mask is the Windows-Key. Anyway, thanks a lot! It 
> works!

You mean it works on your system. There's no guarantee that it will
work on anyone else's. The mapping between keys and keysyms and the
mapping between keysyms and modifier bits are both dependent upon
configuration. E.g. on my system:

	mod1        Alt_L (0x73)
	mod2        Num_Lock (0x4d)
	mod3      
	mod4        Meta_L (0x40)
	mod5        Mode_switch (0x71)

[Alt_L is the left-hand Windows key, Meta_L is the left-hand Alt key.]

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list