Pygame mouse and keyboard listening / Threading help needed

Hi

If I put my keyboard listening in pygame in my drawing/game loop, it obviously won't be checked constantly.
I must obviously have a Thread listening for keyboard input, mouse movement to play my game and update internal game variables.


Is this just a new class I must make with two methods each to listen to pygame keyboard/mouse activity. Case closed?


Thanks
beavoidAsked:
Who is Participating?
 
raj3060Connect With a Mentor Commented:
You can keep it in same method.

Here is an example:
https://lorenzod8n.wordpress.com/2007/05/30/pygame-tutorial-3-mouse-events/
0
 
beavoidAuthor Commented:
Thanks.

Working nicely
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.