A Python library for reading raw HID input from the Steam Deck, bypassing Steam Input.
Project description
Disclaimer: This is a work-in-progress project created during the development of another project. It currently only supports the Steam Deck hardware. It was created with the help of generative AI.
Bitsteam
A low-level Python library for reading raw HID input from the Steam Deck, bypassing the default Steam Input system.
Overview
Bitsteam allows you to capture every button press, joystick movement, trigger pull, and IMU (gyroscope) event directly from the hardware. This is ideal for projects that require custom controller logic, robotics, or interfacing with applications outside of Steam without input conflicts.
Core Features
- Raw HID Access: Reads the device's raw 64-byte data stream.
- Full Input Support: Captures all buttons, analog sticks, triggers, trackpads, and grip buttons.
- Real-time IMU: Provides processed, frame-by-frame delta angles for pitch, yaw, and roll from the gyroscope.
- Conflict-Free: Designed to work alongside a
udevrule to prevent the OS or Steam from intercepting inputs.
Installation
The package is available on PyPI and can be installed with pip:
pip install bitsteam
Quick Start
Important: Supported platforms & Steam input notes
Supported platforms: Linux (Steam Deck). This library is not tested or supported on Windows or macOS.
To avoid Steam translating controller input to keyboard/mouse events, disable or adjust Steam Input for desktop mode. In Steam: Settings → Controller → Desktop Configuration → Edit. Set Gyro Behavior to Gyro To Mouse [Beta] if you want the gyro to remain enabled in desktop mode. Follow the udev instructions in the docs folder to allow raw HID access without running as root.
You can run the shipped example script directly:
python examples/simple_usage.py
Example Code
Here is a simple example to get you started.
import time
from bitsteam import SteamDeck
# Initialize and start the background listener
# The constructor will try to auto-discover the Steam Deck HID device.
# If discovery fails it falls back to `/dev/hidraw2` for compatibility.
deck = SteamDeck()
deck.start()
try:
while True:
a_button = deck.get_button_state('a')
analogs = deck.get_analog_values()
right_trigger = analogs['right_trigger']
print(f"\rA Button: {a_button}, Right Trigger: {right_trigger}", end="")
time.sleep(0.1)
except KeyboardInterrupt:
print("\nStopping...")
finally:
deck.stop()
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Release Checklist
Before publishing a new release:
python -m venv venv
source venv/bin/activate
pip install build twine
# remove old build before building again
rm -rf dist/
# update version in pyproject.toml
python -m build
# verify package metadata and README rendering
python -m twine check dist/*
# publish to PyPI
python -m twine upload dist/*
# use a PyPI API token from account settings
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bitsteam-0.2.1.tar.gz.
File metadata
- Download URL: bitsteam-0.2.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b36f96dc86d4d3e67937a36619b9b9bbd2702b38a836937dbed70a3bf5e73e49
|
|
| MD5 |
56a37f637538b8f16ed6c824cd31096b
|
|
| BLAKE2b-256 |
b48b54a0e85d4ad2e3a852ce3b0977edadc881bd5c0e8a4aedd770d0e544ad1c
|
File details
Details for the file bitsteam-0.2.1-py3-none-any.whl.
File metadata
- Download URL: bitsteam-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd3a30e8e2ba84dc90efe70975e267d49ab04904c6a947502471e702eed04dfc
|
|
| MD5 |
9deeebe2c86ea0d9249d5be0824c2e4a
|
|
| BLAKE2b-256 |
4763ebd494dd0ed62287b0982288403062a620ae52cce84c6d086a023e87503e
|