On Tue, 2003-10-21 at 07:56, Peter Bergmann wrote:

> Can anyone tell me how to query the real state of a specific key
> (Pressed/Released?) with xlib ?
> Does xkb offer functions for this issue?

XKB allows you to switch to "detectable auto-repeat" mode, where you
get Press/Press/Press/Release rather than 
Press/Release Press/Release Press/Release.

You can emulate this on servers without XKB by looking at the timestamps
for the events. (You can look at the GTK+ sources in gtk+/gdk/x11 /
to see both how it uses XKB and how it emulates when XKB is missing)

With that, you should be able to come to something pretty close
to what you want; reference here is the "locate pointer" code in
the GNOME control center 
(gnome-control-center/gnome-settings-daemon/gnome-settings-mouse.c)

That shows how to use XGrabKey and XAllowEvents to trap a press/release
of a key without intervening key presses, while otherwise letting
through the key events to applications.

Regards,
                                                Owen


_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to