On Nov 25, 2004, at 6:45 AM, Mathieu Bouchard wrote:
On Wed, 24 Nov 2004, Hans-Christoph Steiner wrote:
I am working with the core keyboard objects and I noticed that when the key auto-repeats, these objects ([key], [keyup], and [keyname]), send a stream of alternating 0's and 1's. I think that the correct way to do auto-repeat would just be to send out 1's for each repeat event, rather than alternating 0's and 1's. The current condition makes it very hard to use the keys in their held state.
I would like to file a bug report, but I am wondering if there is any reason to keep the current behavior. Attached is a patch that illustrates my point.
AFAIK, the X11 specification does it like that; at the very least, all versions of XFree86 of the last 7 years (or so) do it like that, as well as SUN's Slowlaris/Dope'n'win. I've never seen the explanation.
How then can you detect a key being held down in X? I mean it would be possible by tracking the auto-repeated values, but that seems needlessly complicated. MacOS X HID Manager and Linux input events use auto-repeat events to represent this, which makes things much more flexible. It would be nice to have these objects follow this model more. Maybe auto-repeat mode control be controlled by an argument.
.hc
________________________________________________________________________ ____
Man has survived hitherto because he was too ignorant to know how to realize his wishes. Now that he can realize them, he must either change them, or perish. -William Carlos Williams