Created
June 22, 2024 07:57
-
-
Save segevfiner/27558d5ba6ff2afeba07da656d531122 to your computer and use it in GitHub Desktop.
Turn off Switch Pro Controller Home LED
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# /// script | |
# requires-python = ">=3.11" | |
# dependencies = [ | |
# "pysdl2", | |
# "pysdl2-dll", | |
# ] | |
# /// | |
""" | |
Old versions of SDL2 used to turn on the Switch Pro Controller home LED, which is often | |
undersirable, this script will turn it off. | |
""" | |
import sdl2 | |
sdl2.SDL_SetHint( | |
sdl2.SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED, str(0).encode()) | |
sdl2.SDL_Init(sdl2.SDL_INIT_GAMECONTROLLER) | |
controller = sdl2.SDL_GameControllerOpen(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment