Skip to main content

A Python library for reading raw HID input from the Steam Deck, bypassing Steam Input.

Project description

Disclaimer: This is an work in progress project that happened during the development of another project. Dont take it as done, stable or secure. It only works on the Steam Deck. It was created with the help of generative AI.

Bitsteam

PyPI version License: MIT

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 udev rule 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

Small Tip:

To disable the steam input for desktop, enter Steam>Settings>Controller>Desltop Layout>Edit and remove what the buttons do. But set Gyro Bhavior to Gyro To Mouse [Beta] to permanently enable the gyro, even when entering desktop mode.

Otherwise, the Deck will translate the controller input to keyboard and mouse inputs, which could conflict with the input of your own application.

Example Code

Here is a simple example to get you started.

import time
from bitsteam.deck import SteamDeck

# Initialize and start the background listener
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.

Note To Self:

To compile the python project, execute this in the project dir:

python -m venv venv
source venv/bin/activate
pip install build twine

# remove old build before building again
rm -rf dist/

# remember to iterate the version in pyproject.toml
python -m build

python -m twine upload dist/*
# enter api key (created in pypi user settings > api token)

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

bitsteam-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitsteam-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file bitsteam-0.1.1.tar.gz.

File metadata

  • Download URL: bitsteam-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bitsteam-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d8f9c19ed7118ae68d3add8111f46f2305242dd9403a57f51bc76199c295c30
MD5 cd149f60d5c6e80247fa19323db9e507
BLAKE2b-256 a0560e9d38fcdc4d9f1fd7944d66101463048733dc9e499ee655f04a141425d3

See more details on using hashes here.

File details

Details for the file bitsteam-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bitsteam-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bitsteam-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25d1b5f372474fa43e624fa214b8d97d6f467d39db22e8c53b8a15c36392fcf9
MD5 7a1e193a49530b342e16901aba29621a
BLAKE2b-256 70722dbcb17d1f8cffa06d0be0da92c1258597772e7559fbe636614b45f0a202

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