[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: silly keycode question
From:       Tom Cowell <t.a.cowell () gmail ! com>
Date:       2010-01-24 12:49:36
Message-ID: f5b94a521001240449v61ac6de2g42bf50abb1054629 () mail ! gmail ! com
[Download RAW message or body]

In my experiments, I didn't want to do what Glynn suggested because I
will be repeatedly changing the grabbed keys during the lifetime of
the program. All the calls to XGrabKey seemed like a lot of overhead
to me.

So I did something different: my program is, for other reasons, using
the Xkb extension, and processing XkbStateNotifyEvent to track the
state of modifier keys. When Ctrl is pressed I grab the keys I want
with AnyModifier, and when it is released I release them.

This works for me, but I don't like it, so I think I will probably try
what Glynn has suggested.


Cheers
Tom



2010/1/24 Glynn Clements <glynn@gclements.plus.com>:
>
> Nokan Emiro wrote:
>
>> I need to catch all the Alt+F8 keypresses in my program,
>> and I do it this way:
>>
>> XGrabKey(display, XKeysymToKeycode(display, F8), Mod1Mask, root_window,
>> True, GrabModeAsync, GrabModeAsync);
>>
>> This works fine if no lock keys (ScrollLock, NumLock,
>> CapsLock or combinations of these) are active.
>>
>> Which one is the nicest way to catch Alt+F8
>> irrespectively of the state of Lock keys?
>
> Grab F8 with all combinations of lock modifiers in addition to Mod1,
> i.e. 2^N separate grabs, where N is the number of lock modifiers.
>
> --
> Glynn Clements <glynn@gclements.plus.com>
> _______________________________________________
> xorg mailing list
> xorg@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
>
_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic