Howto handle modified keys

Tomasz Torcz zdzichu at irc.pl
Fri Oct 20 04:57:57 PDT 2006


On Fri, Oct 20, 2006 at 02:39:29PM +0300, Daniel Stone wrote:
> On Fri, Oct 20, 2006 at 11:01:23AM +0200, Philip Pflästerer wrote:
> > is there an easy posibility to react on combinations of keyboard-events 
> > like ALT+F or something like that? I have implemented an event handler, 
> > which reacts on the KeyPress event. When I press the 'ALT'-key, the 
> > event handler recognizes it correctly as keycode '64'. When I press the 
> > 'f'-key, the event handler recognizes ist correctly as keycode '41'. But 
> > when I press 'f' in combination with 'ALT' theres no difference, it 
> > first recognizes 'ALT' and than 'f' (depending on chronological order). 
> > So how can I handle modified keys?
> 
> 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.

  Win-key is Mod4.

-- 
Tomasz Torcz               RIP is irrevelant. Spoofing is futile.
zdzichu at irc.-nie.spam-.pl     Your routes will be aggreggated. -- Alex Yuriev




More information about the xorg mailing list