Skip to content

Commit f8ae737

Browse files
committed
Fix virtual joystick tests with newer SDL2
1 parent 19ca79f commit f8ae737

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sdl2/test/gamecontroller_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def gamepads(with_sdl):
6060

6161
def is_virtual(pad):
6262
stick = sdl2.SDL_GameControllerGetJoystick(pad)
63-
return joystick.SDL_JoystickName(stick) == b"Virtual Joystick"
63+
name = joystick.SDL_JoystickName(stick)
64+
return name in [b"Virtual Joystick", b"Virtual Controller"]
6465

6566

6667
# Test if SDL_GameControllerMappingForGUID is able to be tested

sdl2/test/joystick_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def is_virtual(stick):
7171
virtual = sdl2.SDL_JoystickIsVirtual(stick) == SDL_TRUE
7272
elif isinstance(stick.contents, sdl2.SDL_Joystick):
7373
name = sdl2.SDL_JoystickName(stick)
74-
virtual = name == b"Virtual Joystick"
74+
virtual = name in [b"Virtual Joystick", b"Virtual Controller"]
7575
return virtual
7676

7777

0 commit comments

Comments
 (0)