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

Uploaded Python 3

File details

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

File metadata

  • Download URL: robot_xbox_joystick-0.0.3.tar.gz
  • Upload date:
  • Size: 5.0 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.3.tar.gz
Algorithm Hash digest
SHA256 8ab6436ac7874272773e584a537da5b257a68a50508b23ff4b20808a82a2a8c3
MD5 0443d02999c65ec31936102892188990
BLAKE2b-256 b4d707f9b99d38401bd35711afab517d91ed9aab0f05dabe42525342c964cc69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robot_xbox_joystick-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ada48719206f2bf49440b2af0f400f95350a71b24871c2baa4c4f0f480a2ddce
MD5 4e056bad097320b647169eef88ef17e1
BLAKE2b-256 580749bceb6daf620db92bad88ba67752b565f0eb418ec393ffe1f1c53e1cb0a

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