Closed xiezhipeng-git closed 2 months ago
Are you sure that this is a pygame issue? How many keyboard events are you having to process each second?
I suspect that render_mode="human"
could cause issues
Also, why are you not using gym.utils.play
for keyboard based interactions?
你确定这是一个pygame问题吗?每秒必须处理多少个键盘事件?我怀疑这可能会导致问题
render_mode="human"
另外,为什么您不使用基于键盘的交互?
gym.utils.play
I'm not very sure, because I'm not sure if the WSL environment was also created by pygame. However, it seems that Gym recommends using "human" to showcase in the future. The main reason is that I didn't know Gym already integrated play functionality
I am experiencing an issue where Pygame is unable to detect keyboard events when running the Arcade Learning Environment (ALE) within WSL 2. This problem seems to be specific to the ALE environment, as other Gym environments do not exhibit this behavior and respond to keyboard inputs as expected. When attempting to capture keyboard events using Pygame's event loop, no events are registered, and the program does not respond to any keypresses. This issue persists despite having an X Server (such as VcXsrv or Xming) running and properly configured to handle GUI output from WSL 2. This lack of responsiveness from Pygame's event handling mechanism is hindering the ability to interact with the ALE environment in a real-time manner, which is essential for certain types of reinforcement learning experiments and interactive debugging sessions.
If use cartpole gym,it is ok. If work in windows,it is ok.
Name: pygame Version: 2.5.2 Name: ale-py Version: 0.8.1