Skip to main content

A simple to use interface to the XInput API for Python

Project description

XInput

A simple to use interface to the XInput API for Python.

XInput provides a few simple methods that can be used to query controller information.

Tiny Documentation

Using XInput

XInput provides a few functions:
get_connected() -> (bool, bool, bool, bool) Query which controllers are connected (note: don't query each frame)

get_state(user_index) -> State Get the State of the controller user_index

get_button_values(state) -> dict Returns a dictionary, showing which buttons are currently being pressed.

get_trigger_values(state) -> (LT, RT) Returns a tuple with the values of the left and right triggers in range 0.0 to 1.0

get_thumb_values(state) -> ((LX, LY), (RX, RY)) Returns the values of the thumb sticks, expressed in X and Y ranging from 0.0 to 1.0

set_vibration(user_index, left_speed, right_speed) -> bool (Success) Sets the vibration of the left and right motors of user_index to values between 0 and 65535 or in range 0.0 to 1.0 respectively.

get_battery_information(user_index) -> (<type>, <level>) Returns the battery information for user_index

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

XInput-Python-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

XInput_Python-0.1.0-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file XInput-Python-0.1.0.tar.gz.

File metadata

  • Download URL: XInput-Python-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for XInput-Python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 36e80e55ee5e824f34dbecbc31e395667ba301d8fc04b5eba9ef368cb6f12932
MD5 16a26a03af646003bf9b9e7c118a5b0b
BLAKE2b-256 0f2a1c74e8dba8d758890193e63f694e658a6b95897d075326f1f1b98628cd3b

See more details on using hashes here.

File details

Details for the file XInput_Python-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: XInput_Python-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for XInput_Python-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2acc7fc4ac9e4a16986eb1e529532736846b2ed58607a9e0f5a74e0bad908fc6
MD5 f97052abe48ae9d46f89e21c79220157
BLAKE2b-256 24ec8af9bc82efc475b913181d755a3413a09e9046de80caa59c144cad097e5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page