[Interest] Pressing key (A-Z) behaves differently the pressing modifiers..

Mark Gaiser markg85 at gmail.com
Wed Jan 1 17:15:54 CET 2014


Hi,

I guess this will end up being a bug report, but i don't really if the
results i see is a bug or intended behavior. Thus asking on the list
to make sure before i make a bug report.

I'm playing with a custom event filter and am observing some weird
behavior with key presses.

If i press and hold a normal key (a-z, F1 - F12, .. non modifier keys)
then Qt's event filter acts like i'm rapidly pressing and releasing
it. For example lets take the "A" key in a normal press/release
situation.

Press A:
Event 6 (KeyPress) emits
-- some other events
Event 7 (KeyRelease) emits

That's fine, as one would expect.

Now if i keep it pressed i see:
Event 6 (KeyPress) emits
-- some other events
Event 7 (KeyRelease) emits
Event 6 (KeyPress) emits
-- some other events
Event 7 (KeyRelease) emits
Event 6 (KeyPress) emits
-- some other events
Event 7 (KeyRelease) emits
... and so on.

If i do the same with the CTRL key (press and hold it) then i don't
get that and just get:
Event 6 (KeyPress) emits
-- some other events
Event 7 (KeyRelease) emits

What i see with the CTRL key is what i would expect, but why is the
behavior different for other keys? Is this a bug or is this intended
behavior and should i mimic "press and hold" by adding in a timer?

Cheers,
Mark



More information about the Interest mailing list