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.4.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.4-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: robot_xbox_joystick-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 79aafa2e86b5c2e81c5fe3516524cf128dcb389bfe4093f93ece704d95eeda8e
MD5 15425b2deb9ee8d68aae71933b604a92
BLAKE2b-256 ef0df40aa0078beb2b5f76b08ee1511e45e2950d0dfa193dc33f8e42706d1407

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robot_xbox_joystick-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c743a4dde71d47d825b38ec92c59917362d3faf05e2c4594fb84719ceba9adbf
MD5 d440828d6b1724865bd80087043de25b
BLAKE2b-256 348185e8db666fbfdf73f03babb6beaeed27954653187c94bfb7f2710dd040a5

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