Can pygame.event be obtained only by one thread of python?

want to write a two-person gluttonous snake game with python, which is divided into three threads, the main thread, and controls the entire game interface. The gluttonous snake of two users is two secondary threads. At the same time, pygame is used to display the screen and monitor keyboard information. But I found that when the main thread was listening to the keyboard information, the two secondary threads could not get the keyboard information, so that they could not control the two snakes. so the event of pygame can only be fetched and locked by one thread?


one thread accepts it, then makes the judgment, and distributes it to the other two threads through the pipeline to handle the snake's action respectively.

Menu