Is it possible to change the key repeat settings using Qt? When a
keyboard key is pressed and kept pressed, there is usually a delay
before the key starts repeating. I'd like to reduce this delay.
This is probably not something that is usually desired in an application
(fiddling with user's personal settings), but I'm trying to develop a
game in Qt. In the game, users can move an object with the keyboard.
With the default key delay there is a noticeable pause between the first
movement and subsequent moves.
Documentation didn't turn up anything, so I'm thinking this is not
possible, but it never hurts to ask.
Cheers,
Kimmo
_______________________________________________
Interest mailing list
Inte...@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
30.01.2012, 17:24, "Kimmo Viitanen" <kvii...@gmail.com>:
> Hi,
>
> Is it possible to change the key repeat settings using Qt?
No. You should configure underlying OS driver, or filter key events
in your code (e.g., subclass QApplication and redefine notify()).
--
Regards,
Konstantin
Am 30.01.2012 um 14:24 schrieb Kimmo Viitanen <kvii...@gmail.com>:
> Hi,
>
> ...
> With the default key delay there is a noticeable pause between the first
> movement and subsequent moves.
Hmmm, so you do a single move triggered by a key-press?
IMHO it would be better to detect a key DOWN event instead and keep moving as long as that key is down (or in other words: until you receive a key UP event of the proper key).
Wouldn't that be possible?
Cheers, Oliver
Thanks!
I didn't originally see an easy way to accomplish this, since the
documentation says that both a keyPressEvent and a keyReleaseEvent are
sent on each auto-repeated press. But now after a quick test, it seems
that isAutoRepeat() is false for the last keyReleaseEvent after a series
of auto-repeated events, so based on this I can detect the physical
press and release.
Cheers,
Kimmo