Simple utility to remap Panda3D events
Project description
Panda3D Event Mapper
A simple utility to remap Panda3D events.
Features
- Remap events
- Configure via PRC variables or an API
- Handle keyboards, mice, and gamepads
Installation
Use pip to install the panda3d-eventmapper
package:
pip install panda3d-eventmapper
Example
import sys
from direct.showbase.ShowBase import ShowBase
import panda3d.core as p3d
import eventmapper
p3d.load_prc_file_data(
'',
'event-map-item-quit escape q\n'
'event-map-item-move-forward raw-w\n'
'event-map-item-move-backward raw-s\n'
'event-map-item-move-left raw-a\n'
'event-map-item-move-right raw-d\n'
)
class GameApp(ShowBase):
def __init__(self):
super().__init__()
self.eventmapper = eventmapper.EventMapper()
self.accept('quit', sys.exit)
self.accept('move-forward', print, ['move forward'])
self.accept('move-backward', print, ['move backward'])
self.accept('move-left', print, ['move left'])
self.accept('move-right', print, ['move right'])
GameApp().run()
Running Tests
First install panda3d-simplepbr
in editable mode along with test
extras:
pip install -e .[test]
Then run the test suite with pytest
:
pytest
Building Wheels
Install build
:
pip install --upgrade build
and run:
python -m build
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file panda3d-eventmapper-0.3.0.tar.gz
.
File metadata
- Download URL: panda3d-eventmapper-0.3.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bc3c488653e8198fd8d47507c8bf3c445ebeddf51a2a2ec4107b2b7ac6b5807 |
|
MD5 | 2fd79d6a4cecfd38422225fad477dacd |
|
BLAKE2b-256 | 349e3922c5432da89a95be5ed1774fcaf6fcf47de4de8bde9689a07a7fa31bbc |
File details
Details for the file panda3d_eventmapper-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: panda3d_eventmapper-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 030420e0cfc708761e6e1b58397071acd76d6296c2bfcc5fc4373f49b3c9b8a8 |
|
MD5 | e20e030a28d7014e23e9e227df79e1d5 |
|
BLAKE2b-256 | a7e4eb08f71b88249b38853900b293a42580597e1cf543ade58837fce4e28cd3 |