[Gambas-user] Knowing keyboard state without being in a key event
Rob
sourceforge-raindog2 at ...94...
Thu Jul 8 15:51:05 CEST 2004
On Thursday 08 July 2004 09:23, DASNOIS Benjamin wrote:
> I didn't see anything to do this but I hope there's a way to:
> I would like to know the state of the keyboard anywhere in the
> code (read: without being in a keyboard event) I need to know
> if some keys are pressed when being in a loop. I hope someone
> can help me.
See my space game example from a few weeks ago (the animation is
too slow but the keyboard stuff works fine.) Basically you need
to declare a class-level variable reflecting key state, and set
that in each KeyPress or KeyRelease event handler.
Rob
More information about the User
mailing list