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

Mark Gaiser markg85 at gmail.com
Wed Jan 1 18:41:03 CET 2014


Hi George,

Thank you very much for clearing that up.
I'm now using "isAutoRepeat" in the mix which solves my issue.

Cheers,
Mark

On Wed, Jan 1, 2014 at 6:11 PM, George Tasopoulos
<tasopoulos.yorghos at gmail.com> wrote:
> This is intended, and it's because when typing you'd expect keeping a letter
> key pressed to keep producing that letter (I'm not sure about Function keys
> though). Modifier keys don't have that functionality because you normally
> press them combined with another key and so you need them to "stay" pressed.
>
> Look at this function:
> http://qt-project.org/doc/qt-5/qkeyevent.html#isAutoRepeat
> For non-modifier keys and not key combinations, it should return true when
> an event comes from that behaviour and so you can use it to screen for it
> and ignore extra events.
>
> --
> Yours sincerely,
> George Tasopoulos
>
>
> On 1 January 2014 16:15, Mark Gaiser <markg85 at gmail.com> wrote:
>>
>> 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
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
>



More information about the Interest mailing list