Skip to main content

Build Status Package Versions Panda3D Versions License

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

BSD

Metadata

Release files for panda3d-eventmapper 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for panda3d-eventmapper 0.3.0
File Size Uploaded
panda3d-eventmapper-0.3.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for panda3d-eventmapper 0.3.0
File Interpreter ABI Platform
panda3d_eventmapper-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / panda3d-eventmapper-0.3.0.tar.gz

Download URL panda3d-eventmapper-0.3.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2bc3c488653e8198fd8d47507c8bf3c445ebeddf51a2a2ec4107b2b7ac6b5807
BLAKE2b-256 checksum
How to use checksums
349e3922c5432da89a95be5ed1774fcaf6fcf47de4de8bde9689a07a7fa31bbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / panda3d_eventmapper-0.3.0-py3-none-any.whl

Download URL panda3d_eventmapper-0.3.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
030420e0cfc708761e6e1b58397071acd76d6296c2bfcc5fc4373f49b3c9b8a8
BLAKE2b-256 checksum
How to use checksums
a7e4eb08f71b88249b38853900b293a42580597e1cf543ade58837fce4e28cd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page