[Kde-games-devel] keyboard delay on keyPressEvent

Albert Astals Cid tsdgeos at terra.es
Wed Feb 25 22:38:24 CET 2004


A Dimecres 25 Febrer 2004 21:54, Thomas Friedrichsmeier va escriure:
> > If you say kasteroids is the behaviour you want you might have a look at
> > this
> >
> > void KAstTopLevel::focusInEvent( QFocusEvent *e )
> > {
> > // bla bla
> >     XAutoRepeatOff( qt_xdisplay() );
> >     KMainWindow::focusInEvent(e);
> > }
>
> [...]
>
> > This sets autorepeat off the the windows has the focus and sets in on
> > when it loses it and when the window is destroyed. I could not find
> > qt_xdisplay() in assistant documentation but looking for it in the qt src
> > it says
>
> Actually, this is not even necessary, and it's not the thing you're looking
> fore. Rather, the whole point is, to not act directly on the keyboard
> events, but rather to use your own timing. I'm using essentially the same
> method in taxipilot, so I'll outline the basic steps (quoting the relevant
> lines from kasteroids):
>

Duhh, my bad, thanks for clarifying it, i looked at KAsteroids code and though 
it was that but i was clearly wrong.

Albert.



More information about the kde-games-devel mailing list