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.1.tar.gz (3.6 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.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: robot_xbox_joystick-0.0.1.tar.gz
  • Upload date:
  • Size: 3.6 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.1.tar.gz
Algorithm Hash digest
SHA256 16fee1f3ef50feb098a3b1a74d93c567e766f523de308ecc6c059d66716e537c
MD5 5a67b61b0df0e7e2c73fc61e97c5eb30
BLAKE2b-256 1a68b59927431ec7a9fcb7d09bbe877333c9ac9daac6abbd53906f898bf5b1d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robot_xbox_joystick-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5020348dc48569fcc021f6c4973758d5d4df96bd8b098472be31b2fdac6cb646
MD5 65d68f547763e5be47cbac501e6386a9
BLAKE2b-256 5f072f98ebfdb69bbe2c34309dce8c423cac149305aa1e56ff7f64a52d607baf

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