https://github.com/tiagocoutinho/enjoy
Pure python, concurrency agnostic, access to linux input system. Useful for controlling game pads, joysticks
https://github.com/tiagocoutinho/enjoy
input linux python
Last synced: 20 days ago
JSON representation
Pure python, concurrency agnostic, access to linux input system. Useful for controlling game pads, joysticks
- Host: GitHub
- URL: https://github.com/tiagocoutinho/enjoy
- Owner: tiagocoutinho
- License: gpl-3.0
- Created: 2021-07-16T16:30:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-31T11:11:06.000Z (over 1 year ago)
- Last Synced: 2025-03-14T07:03:19.719Z (about 1 month ago)
- Topics: input, linux, python
- Language: Python
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.rst
- License: LICENSE
Awesome Lists containing this project
README
# enjoy
[](https://pypi.python.org/pypi/enjoy)
[](https://pypi.python.org/pypi/enjoy)Pure python, concurrency agnostic, access to linux input system. Useful for controlling game pads, joysticks
## Command line
```
$ python -m enjoy.cli table
+---------------------------------+--------------------+-------------------------+
| Sony PLAYSTATION(R)3 Controller | /dev/input/event26 | SYN, KEY, ABS, MSC, FF |
+---------------------------------+--------------------+-------------------------+
...$ python -m enjoy.cli listen /dev/input/event26
X: 129 Y:126 Z: 0 | RX: 128 RY:128 RZ: 0 | EAST WEST
```## API
API not documented yet. Just this example:
```python
import time
from enjoy.input import find_gamepadspad = next(find_gamepads())
abs = pad.absolutewith pad:
while True:
print(f"X:{abs.x:>3} | Y:{abs.y:>3} | RX:{abs.rx:>3} | RY:{abs.ry:>3}", end="\r", flush=True)
time.sleep(0.1)
```