You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I seem to have encountered an issue: When I am holding down the mouse in my pygame project, vscode hits a breakpoint then none of my clicks on the vscode window do anything.
Here is some code which you can run to replicate it which causes this error for me:
importpygamepygame.init()
win=pygame.display.set_mode((500, 500))
r=Truewhiler:
foreventinpygame.event.get():
ifevent.type==pygame.QUIT:
r=Falseifpygame.key.get_pressed()[pygame.K_SPACE]:
pass# Breakpoint here works if mouse isn't downwin.fill((255, 255, 255))
pygame.display.update()
Steps to replicate:
Make a breakpoint after the key.get_pressed if statement on the pass (where the comment is)
Run the code
Hold the mouse down on the pygame window and while holding it down press space.
Other things to note
The keyboard input still works when this error occurs, it's just the mouse clicks are not able to be detected at all.
This error occurs at any time it breakpoints when you have your mouse held down.
If you run this code again and without holding the mouse down press space, you can see it doesn't have the error!
I think this is not an issue on Windows as I didn't have this issue when I ran it there last.
At one point I disabled all my extensions but the python debugger and yet it still failed.
Video showcase of what happens can be seen here. This is the exact steps above, recorded as a video. To stop running, you can either force quit the window or what I did was press f5 (my shortcut for stop) and it stopped (the keyboard still works when in this state) and the mouse started working again, and I re-ran it but the second time was without holding down the mouse and you could see it working properly.
I've tried modifying the debug focus settings in vscode to no avail.
I'm running Ubuntu 22.04.4 LTS with pygame 2.5.2 (SDL 2.28.2, Python 3.10.12) and vscode version 1.89.1, with the windowing system being Wayland.
Any help would be appreciated!
The text was updated successfully, but these errors were encountered:
If you release your mouse fast enough and then run pygame.event.___ (in this case I used .pump()) then it will not freeze!
importpygamepygame.init()
win=pygame.display.set_mode((500, 500))
r=Truewhiler:
foreventinpygame.event.get():
ifevent.type==pygame.QUIT:
r=Falseifpygame.key.get_pressed()[pygame.K_SPACE]:
importtimetime.sleep(1)
pygame.event.pump()
pass# Breakpoint here works if you release your mouse in the 1 second window provided by the time.sleep!!win.fill((255, 255, 255))
pygame.display.update()
To see it:
Run the code
Hold down the mouse and while holding down the mouse press space
BUT release your mouse in the 1 second before it breakpoints
You can see it works properly again!
I'll just put those 3 lines before every piece of code that fails for now until it gets fixed
I seem to have encountered an issue: When I am holding down the mouse in my pygame project, vscode hits a breakpoint then none of my clicks on the vscode window do anything.
Here is some code which you can run to replicate it which causes this error for me:
Steps to replicate:
key.get_pressed
if statement on thepass
(where the comment is)Other things to note
Video showcase of what happens can be seen here. This is the exact steps above, recorded as a video. To stop running, you can either force quit the window or what I did was press f5 (my shortcut for stop) and it stopped (the keyboard still works when in this state) and the mouse started working again, and I re-ran it but the second time was without holding down the mouse and you could see it working properly.
I've tried modifying the debug focus settings in vscode to no avail.
I'm running
Ubuntu 22.04.4 LTS
withpygame 2.5.2 (SDL 2.28.2, Python 3.10.12)
and vscode version1.89.1
, with the windowing system beingWayland
.Any help would be appreciated!
The text was updated successfully, but these errors were encountered: