Skip to main content

I/O agnostic approach to linux input system

Project description

enjoy

Pypi Version Python Versions

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:

import time
from enjoy.input import find_gamepads

pad = next(find_gamepads())
abs = pad.absolute

with 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)

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

enjoy-0.1.2.tar.gz (32.8 kB view hashes)

Uploaded Source

Supported by

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