Skip to main content

Library for basic xbox joystick controllers.

Project description

docs

Documentation Status

package

PyPI Package latest release PyPI Wheel Supported versions

Library for basic xbox joystick controllers.

  • Free software: MIT License

Installation

pip install robot-xbox-joystick

You can also install the in-development version with:

pip install https://github.com/fmorton/robot-xbox-joystick/archive/main.zip

Xbox Joystick Example

import pygame
import pytest

from robot.xbox_joystick import XboxJoystick

joystick = XboxJoystick().connect()

print("Joystick connected")

running = True

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        elif event.type == pygame.JOYBUTTONDOWN:
            print(f"Button {event.button} pressed on joystick {event.joy}")

            if event.button == 2:  # 'X' button to quit
                running = False
        elif event.type == pygame.JOYAXISMOTION:
            print(f"Joystick axis {event.axis} value {event.value}")

Testing

To run all the tests run:

pytest -s

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robot_xbox_joystick-0.0.6.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robot_xbox_joystick-0.0.6-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file robot_xbox_joystick-0.0.6.tar.gz.

File metadata

  • Download URL: robot_xbox_joystick-0.0.6.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for robot_xbox_joystick-0.0.6.tar.gz
Algorithm Hash digest
SHA256 309bf2b205556b91763b0d662f9a61e839c387072445d41bc9b0f8fc9df87831
MD5 aa3e333cd8069f2067f9f417da760b24
BLAKE2b-256 824604204b041e17519a2c8643eba6672d1ad76a3835897f7900f441f170ce12

See more details on using hashes here.

File details

Details for the file robot_xbox_joystick-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for robot_xbox_joystick-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4bdd332954e24a52ad7942e2b1a3a6869ce0314f32df61aa9dcbae68340f6df8
MD5 f2e9efd53710d22ea7d020b8963abc99
BLAKE2b-256 b9ffbf95f121a8e11d2dbb1c6a337ce817fe935edff0ea862810d78802769a0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page