[Kde-games-devel] keyboard delay on keyPressEvent

Jan Bernatik bernatik at kn.vutbr.cz
Sun Feb 29 16:00:14 CET 2004


> bool KAstTopLevel::processKeyPress( QKeyEvent *event )
> {
> // snip
> /* the above lines determined that e.g. the key for rotating left has just 
> been pressed (or is auto-repeating) */ 

thanks for help, just one question. Autorepeat in my case generates 
KeyPress and KeyRelease events in cycle. So it means that in kasteroids 
case, it sets rotateLeft (for example) true and false with every 
autorepeat event ?
the truth is, I didn't yet understand exactly, what this code:

KKey key(event);
     Action a = Invalid;
     QMap<Action, KAction*>::Iterator it = keycodes.begin();
     for (; it != keycodes.end(); ++it)
     {
        if ( (*it)->shortcut().contains(key) )
        {
            a = it.key();
            break;
        }
     }

does exactly, and why is it doing that what it is doing :)
It's transforming Action to KAction or something simmilar.
I'm using at the moment just QT without KDE libraries (yeah, i know this 
is kdegames dev. list) but in this stage of learning I want to make it 
as simple as I can, understand a bit QT, and then start with KDE 
libraries & stuff.

thanks once more, have a nice day

Jan



More information about the kde-games-devel mailing list