Skip to main content

pypad2 is a lightweight evdev bridge to handle ps4 gamepad input

Project description


PyPad2

PyPad2 is simple and easy to use wrapper around evdev to read gamepad input from PS4 controller

License:

License

Python & Pypi:

Python PyPi

Install & Upgrade:

# install via pypi
pip3 install pypad2
# upgrade
pip3 install --upgrade pypad2

Import:

from pypad2 import Gamepad, Keymap

Usage:

Examples:

from pypad2 import Gamepad, Keymap

# create instance
gamepad = Gamepad(path='/dev/input/event2')

# get gamepad's name
name = gamepad.name()
print(name)

# get gamepad's status
status = gamepad.status()
print(status)  # print's: {'capacity': '100', 'status': 'Discharging'}

# set gamepad's color
gamepad.color()

while True:
    buttons = gamepad.pressed()
    for button in buttons:
        print(f'{button.name}: {buttons[button]}')

Author:

👨🏼‍💻 Vinzenz Weist

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

pypad2-2.5.0.tar.gz (15.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