On Jun 27, 2004, at 6:58 PM, Alan Coopersmith wrote:

Davy Durham wrote:
Hi,
Is there a flag somewhere in the _XEvent union on a KeyPress and KeyRelease event that indicates whether this is an event generated by auto-repeat versus one generated by the physical key being pressed or released? I'm sorry if this question has been asked a million times. I'm no X11 developer; I'm only trying to make a quick patch to an existing library.

You need to use the X Keyboard (aka XKB) extension to determine if an
event is autorepeat-generated or a real keypress. In there, the function
XkbSetDetectableAutoRepeat will allow you to disable the auto-generated
KeyRelease events for autorepeats, so a KeyPress followed by a KeyPress
of the same key, without a KeyRelease in between, indicates auto-repeat.

A hacky option is to check the time. I believe that a KeyPress and KeyRelease
have the same event time if they are generated using autorepeat.


-a

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

Reply via email to