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

Re: [pygame] raw_input() and pygame.event.get()



On Sun, 2006-12-10 at 22:12 -0600, Mike Wyatt wrote:
> Oops, I forgot to mention that.  I'm using raw_input() because I want
> to focus on getting my game working before putting time into writing a
> GUI.  Without a GUI, the only way I can get user input is with
> raw_input().  I'm working on my networking code, so I need to have
> each game instance ask the user (i.e. myself) to host a new game or
> join an existing game.

Use the pygame event filtering to block certain event types. Turn this
off and on around your input_raw call.

http://pygame.org/docs/ref/event.html#pygame.event.set_blocked

pygame.event.set_blocked(pygame.KEYDOWN | pygame.KEYUP)
value = raw_input()
pygame.event.set_blocked(None)