Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new `joy2key` implementation, using PySDL2 for joystick event handling. PySDL2 is a python module that wraps SDL2 (and other SDL libraries) using the built-in `ctypes` module. Pros: * event handling is simplified a bit, using SDL's event loop. * (subjective) the code is a bit more structured and easy to follow. * joystick handling is rewritten based on EmulationStation code, movement is smoother and scrolling is improved. * support for input repeat to improve scrolling, just keep the input pressed and scrolling continues Cons: * module is a bit larger (296 LOC vs 224 in current joy2key.py) * needs PySDL2 (which might not be packaged, see the notes below) and SDL2 * arguably, device config to keyboard event mapping is more complex (abstracted as InputDev) Notes: * availability of PySDL2 as a system package is good, but it's not standard in Debian 10 (stable) at the moment. The module is present though (as a backport) in Ubuntu 18.04 (and later) and Raspberry Pi OS (Buster). When it will be universally available, we should probably revisit the code that checks for the version and make it a hard requirement in `get_retropie_depends`, similar to `python3-pyudev`. * added PgUp/PgDown to the default parameters for `joy2key`, they are mapped in a similar fashion to EmulationStation to the shoulder buttons. This doesn't apply to Runcommand's invocation, since it uses a different set of parameters. * added a configuration option in `runcommand` for selecting the joy2key version used. Default is the SDL version (when PySDL2 is installed), with the ability to fallback to the previous version (udev based).
- Loading branch information