-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
docseasyAn easy challenge to solveAn easy challenge to solvegood first issuejoystickpygame.joystickpygame.joystick
Description
Hijacking top post for tasks:
- Add environment variable to pygame module docs with the other environment variables
- Add note about current behaviour (defaults to no joystick events for apps without focus) to joystick module introduction somewhere.
- Nice to have: open a new issue about adding
SetSDLHint()
&GetSDLHint()
(names not final) to new context module.
Windows
Python 3.10
PyGame 2.1.2
I had to go back to version 2.1.0 and it works again : my pygame window that captures all joystick events doesn't capture anything anymore when I switch to another window
Current behavior:
No joystick events catched
Expected behavior:
joystick events catched (wirks on pygame 2.1.0)
code
# Extract from my 2.1.0 working code
pygame.init()
screen = pygame.display.set_mode((200, 200), pygame.NOFRAME)
hwnd = pygame.display.get_wm_info()["window"]
win32gui.SetWindowPos(hwnd, win32con.HWND_TOPMOST, 600, 300, 0, 0, win32con.SWP_NOSIZE)
...
joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())]
for joy in joysticks:
print(joy.get_name(), joy.get_id(), joy.get_guid(), joy.get_instance_id())
if joy.get_name() == 'My joystick 1':
MyJoysticks['My joystick 1']={}
MyJoysticks['My joystick 1']['joy'] = joy
MyJoysticks['My joystick 1']['joy'].init()
...
while 1==1:
...
PosJoy1 = MyJoysticks['My joystick 1']['joy'].get_axis(0)
...
Metadata
Metadata
Assignees
Labels
docseasyAn easy challenge to solveAn easy challenge to solvegood first issuejoystickpygame.joystickpygame.joystick