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.2.tar.gz (4.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.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: robot_xbox_joystick-0.0.2.tar.gz
  • Upload date:
  • Size: 4.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.2.tar.gz
Algorithm Hash digest
SHA256 c396e318abaf4b5fb3126a03038a29125aa9d3a58a4877e719213eab8b073c88
MD5 bd89e54e81755534c8c1d4f883f85813
BLAKE2b-256 3965a8cfd1395c8ad2f24a495a8506c10961eaf30731bc4353ba3a7c04a03d9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robot_xbox_joystick-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a9cbb42b11bd762890c21194ffeca715a39daedf4603fe6c4e6a550902a0d2a3
MD5 ceb912a5b9f2b4ea48fbe1a174af38ec
BLAKE2b-256 8055f08b17bb5ce94ce1caf9f1e6568936bb667cbcc347638e36eb8ab5bfb071

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