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

Re: [pygame] Re:



note that get_pressed checks if the key is down at the time of the
call. If you press the key and release it between two loop iterations,
this keypress will not be caught by get_pressed. This shouldn't be an
issue though, unless you're game is not getting a lot of fps. Usually
a key is pressed long enough so that calling get_pressed once per
iteration catches it.

On Sun, Aug 24, 2008 at 9:48 PM, Jake b <ninmonkeys@xxxxxxxxx> wrote:
> A more elegant solution is to use pygame.key.get_pressed() (
> http://www.pygame.org/docs/ref/key.html#pygame.key.get_pressed )
>
> This checks if a key is being held down. Otherwise you have the option
> of using the KEYDOWN / KEYUP events, and saving the state. ( Sounds
> like get_pressed would work better in this case. )
> --
> Jake
>