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.5.tar.gz (5.1 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.5-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: robot_xbox_joystick-0.0.5.tar.gz
  • Upload date:
  • Size: 5.1 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.5.tar.gz
Algorithm Hash digest
SHA256 c65d5af903e51338174ef0e8b6f61b78136afd2c25d41e65afb9fbbfb720b320
MD5 e360f8308a7e2fd8759db2b529bece43
BLAKE2b-256 eed4b50f3f6c82085c6029338eabc2bfec6aa5928ae202d62a4663247e2014c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robot_xbox_joystick-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eeed6997c449e47180f9184faa44cbefa33409fa4537006a7acbf62a4323c354
MD5 685f41fa08b474668bfc35dd3a308300
BLAKE2b-256 67ffabd7cbbff927ea2d3b54a7268b6d3d25bd574592b585bcf5a9c927d10e4f

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