[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] eventstates



I this case I made it up. It is simple. It is just a dictionary that
is refrenced by e.key or e.button. It is true or false. I set it true
on button down and false on button up. In this way I can track the
state of everybutton on the keyboard. There is most likely a better
way but I did not know the system that well so I did it in a way the I
know works in a way I understand.
DEK

On 12/2/05, Dan <dan@xxxxxxxxxxxxxxxx> wrote:
> > eventstates[e.key]=True
> > if eventstates[K_RSHIFT]==True : # if Right shift key pressed then
> >    if eventstates[K_ESCAPE]== True : return #quit program
>
> I see this "eventstates" array/object from time to time on the mailing
> list. Is it a pygame built-in or just a convention? Is it documented
> anywhere?
>
> --
>    Your parents did it. How cool can it be?
>       - Billboard in Mississippi to discourage teen smoking.
>
>
>