Files
wallpaper-engine-caelestia/pyprojs/xbox-buttons-test.py
2026-03-30 14:53:09 -06:00

19 lines
396 B
Python
Executable File

import pygame
pygame.init()
pygame.joystick.init()
joystick = pygame.joystick.Joystick(0)
joystick.init()
print(f"Control detectado: {joystick.get_name()}")
print("Presiona botones, Ctrl+C para salir.")
while True:
pygame.event.pump()
for i in range(joystick.get_numbuttons()):
if joystick.get_button(i):
print(f"Botón {i} presionado")
pygame.time.wait(100)