[PATCH] xkb: Don't press+release keys on key events

Peter Hutterer peter.hutterer at who-t.net
Wed Jun 3 16:25:43 PDT 2009


On Wed, Jun 03, 2009 at 02:38:24PM +0200, Matthias Hopf wrote:
> On May 22, 09 10:59:52 +1000, Peter Hutterer wrote:
> > > IMHO the key repeat logic is broken here, Press+Release events should
> > > only be committed if the key state is down, not for up AND down.
> > > I verified that key repeat is still working, and so far I couldn't find
> > > any side effects - but of course I don't have all keyboard layouts and
> > > special hardware and architectures.
> > I believe this may be a leftover of the old key repeat code. At least the
> > evdev driver discards all key repeats in-driver already, so to get two key
> > events in a row you have to be syncing up xtest's fake input events right.
> 
> I *think* I received keydown/up events on repeat with evdev as well, but
> I have to revalidate. It could have been an older evdev driver, though.

evdev 2.2 and server 1.6 shouldn't have in-driver repeats, earlier versions
of either still do. See 7fb654a68a26ad5f019a902312c6b94dbe9c3ea in evdev.
> 
> > > Subject: [PATCH] xkb: Don't press+release keys on key events.
> > This is not correct. You're preventing a fake key press repeat on key
> > release events if the key is not currently logically down. I'd prefer a more
> > extensive commit message that explains exactly that.
> 
> Right, the subject is not conclusive. Will fix that.
> 
> > The behaviour is still there on a key press event. Maybe it should be
> > removed from there too? daniel?
> 
> No, AFAICS this is still needed for generating key repeats with the kbd
> driver.

What I'm getting at is that repeats should be triggered through XKB only, so
if the driver still sends events for autorepeat maybe that could be fixed in
the driver. Note that this applies for server 1.7 where XKB is mandatory.

Cheers,
  Peter


More information about the xorg-devel mailing list