mirror of
https://github.com/mupen64plus/mupen64plus-ui-python.git
synced 2025-04-02 10:51:53 -04:00
Sanitize joystick names
This commit is contained in:
parent
90b4aa16c4
commit
791a10c9c4
1 changed files with 4 additions and 1 deletions
|
@ -73,7 +73,10 @@ class Joystick(QObject):
|
|||
if not SDL_WasInit(SDL_INIT_JOYSTICK):
|
||||
if SDL_InitSubSystem(SDL_INIT_JOYSTICK) == 0:
|
||||
for i in range(SDL_NumJoysticks()):
|
||||
self.joystick_names.append(SDL_JoystickNameForIndex(i))
|
||||
joystick_name = SDL_JoystickNameForIndex(i)
|
||||
if isinstance(joystick_name, bytes):
|
||||
joystick_name = joystick_name.decode()
|
||||
self.joystick_names.append(joystick_name.strip())
|
||||
|
||||
self.joystick_timer.timeout.connect(self.process_events)
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue