[Qt-interest] How to Limit Keyboard input rates ?

Nikos Chantziaras realnc at arcor.de
Sun May 9 00:22:19 CEST 2010


On 05/09/2010 12:52 AM, Aaron Lewis wrote:
> Hi,
> 	I have a QGraphicsView , and re-implemented keyPressEvent.
>
> 	Does anyone know howto limit input limits ?
>
> 	So far i got a dirty way , use QTimer&  a boolean value can do the
> trick , but is there an offical way ?

No, this is up to the user to configure in his OS.  The correct way to 
do it is to ignore key events that are the result of auto repetition. 
 From then on, you can handle it in whatever way you like.  For 
game-like applications for example, you simply check key press and key 
release events, viewing the keys as if they were a gamepad.  When a key 
pressed, you trigger an action.  If the action is continuous, you stop 
it again when the key is released.

If you still need auto repeat, then you need to time the actions 
yourself (like you do now.)



More information about the Qt-interest-old mailing list