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

Uploaded Source

File details

Details for the file enjoy-0.1.2.tar.gz.

File metadata

  • Download URL: enjoy-0.1.2.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for enjoy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 26efd4e9c68b8eb010793e76482978f3f82115030571584cbbc6c560c1e249d1
MD5 5420f965ca133abf5b9afd49655ed96b
BLAKE2b-256 f8ce6d311feb8e01dfffc3f730a9211e2418fe272f80432d79f3612c1c7b26dd

See more details on using hashes here.

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