Metadata-Version: 2.4
Name: bitsteam
Version: 0.1.0
Summary: A Python library for reading raw HID input from the Steam Deck, bypassing Steam Input.
Author: weber-moritz
License: MIT License
        
        Copyright (c) 2025 Moritz Weber
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/weber-moritz/bitsteam
Project-URL: Bug Tracker, https://github.com/weber-moritz/bitsteam/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: System :: Hardware :: Hardware Drivers
Classifier: Intended Audience :: Developers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: hidapi
Requires-Dist: scipy
Dynamic: license-file

**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](https://badge.fury.io/py/bitsteam.svg)](https://badge.fury.io/py/bitsteam)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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:

```bash
pip install bitsteam
```

## Quick Start

Here is a simple example to get you started.

```python
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](https://github.com/your-username/bitsteam/issues).

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
