-
-
Notifications
You must be signed in to change notification settings - Fork 212
Open
Labels
_sdl2pygame._sdl2pygame._sdl2bugNot working as intendedNot working as intendedcontrollerpygame.controllerpygame.controller
Description
Environment:
pygame-ce 2.5.5 (SDL 2.32.6, Python 3.13.6)
Platform: Linux-6.16.3-76061603-generic-x86_64-with-glibc2.35
System: Linux
System Version: #202508231538~1758561135~22.04~171c8de SMP PREEMPT_DYNAMIC Mon S
Processor: x86_64 SSE2: Yes AVX2: Yes NEON: No
Architecture: Bits: 64bit Linkage: ELF
Python: CPython 3.13.6 (main, Aug 6 2025, 22:57:45) [Clang 20.1.4 ]
GIL Enabled: True
pygame version: 2.5.5
SDL versions: Linked: 2.32.6 Compiled: 2.32.6
SDL Mixer versions: Linked: 2.8.1 Compiled: 2.8.1
SDL Font versions: Linked: 2.24.0 Compiled: 2.24.0
SDL Image versions: Linked: 2.8.8 Compiled: 2.8.8
Freetype versions: Linked: 2.13.3 Compiled: 2.13.3
Display Driver: Display Not Initialized
Mixer Driver: Mixer Not Initialized
Other environment details, not included in print_debug_info(), that might help:
- Relevant hardware
Nintendo Switch Joy-Con (L)
Additional output from the test code
joystick.get_name(): Joy-Con (L)
joystick.get_guid(): 050067007e0500000620000001800000
controller.name: Nintendo Switch Joy-Con (L)
Current behavior:
There is a invalid pointer error when trying to get_mapping()
Expected behavior:
When using get_mapping() a dictionary is returned
Steps to reproduce:
- Connect a single controller
- Initialize controllers
- Get the mapping of the first controller
Test code
Assuming only one controller is plugged in
import pygame._sdl2.controller
if __name__ == "__main__":
pygame.print_debug_info()
pygame._sdl2.controller.init()
pygame.joystick.init()
print(pygame._sdl2.controller.get_init())
controller = pygame._sdl2.controller.Controller(0)
joystick = pygame.joystick.Joystick(0)
controller.init()
print(f"joystick.get_name(): {joystick.get_name()}")
print(f"joystick.get_guid(): {joystick.get_guid()}")
print(f"controller.name: {controller.name}")
print(controller.get_mapping())Error output
munmap_chunk(): invalid pointer
Metadata
Metadata
Assignees
Labels
_sdl2pygame._sdl2pygame._sdl2bugNot working as intendedNot working as intendedcontrollerpygame.controllerpygame.controller