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

Re: [pygame] keyboard input and mouse



 --- Michael <mogmios@mlug.missouri.edu>
> What else is the loop doing? If you're processing
> one input event, doing 
> something, doing output, and looping then if doing
> something or output 
> takes a long time then input processing might seem
> sluggish. As was 
> suggested before you should only watch events you're
> actually interested 
> in. Also try to break whatever processing and output
> you're doing up so 
> that it doesn't take to long in an individual cycle.
> Is there anywhere 
> you're program is stopping to wait for a certain
> event or anything like 
> that? If so then that's obviously a problem. 

No, nothing blocks for an event, my event loop is:

for event in pygame.event.get([pygame.KEYDOWN,
pygame.KEYUP]):
	    if event.type == pygame.KEYDOWN:
               # ...
            elif event.type == pygame.KEYUP:
               # ...
 
Till now I don't need mouse, so in my program there is
nothing about it, but moving it during the program
cause the previuos call to get() returning no data




	

	
		
____________________________________________________________
Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo! 
http://companion.yahoo.it