MAJOR UPDATE! 9th of May 2019:
- KeyMapper now supports Panda3D’s additional devices! (Gamepads, etc.)
- KeyMapper no longer requires GameSaver.
- Instead, it is expected that developers will provide their own file-handling, as they prefer. See the documentation for details.
- Error-handling is now a little better (I feel), with an error-dialogue that’s shown when trouble is encountered while saving or loading
It’s also now on GitHub, and should be found here:
And finally, there’s a new example mini-game to go along with it–a sort of Lander-style gem-collecting game.
KeyMapper is a module intended to provide a simple-to-use key-binding system and GUI, allowing users to re-bind the controls of an application.
Specifically, it offers:
- Simple key-handling, including support for re-bindable “held” keys and key-events
- Support for near-transparent handling of Panda3D’s additional devices, such as gamepads. (Including axial inputs, like thumbsticks.)
- A GUI interface, constructed in such a way as to enable alteration and customisation of the interface via sub-classing; the default GUI uses DirectGUI.
With some devices attached, the first attempt to bind a key may automatically end up bound to the mouse-button. This seems to be an engine-level issue, and has been reported!
The default UI is only navigable by mouse; implementing navigation by other devices is left to the developer, should it be desired.
Due to Panda not producing key-release events for key-combinations (that is, keys in combination with modifiers; “alt-r”, for example), support for key-combinations is somewhat broken and restricted via a default parameter that prevents them from being bound.
Support for binding mouse-buttons should work properly, but does involve a slight hack behind the scenes; this is a result of an odd issue in which DirectDialogue prevents mouse-press events from being sent–but not mouse-release, key-press or key-release events. This thread was created for this issue.