Pygame mouse and keyboard listening / Threading help needed


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?

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

Here is an example:
beavoidAuthor Commented:

Working nicely
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.