OpenStickCommunity / GP2040-CE

Multi-Platform Gamepad Firmware for Raspberry Pi Pico and other RP2040 boards
https://gp2040-ce.info
MIT License
1.42k stars 314 forks source link

use new A3 and A4 to emulate tpad click position on PS4 #1060

Closed bsstephan closed 3 months ago

bsstephan commented 3 months ago

when the TP "button" is pressed, we formerly did nothing with the touchpad data, including not even sending the bit to indicate there is touchpad data, which was fine for normal purposes. however, we can use the dpad to emulate position data as if a finger was actually touching it, and send touchpad data for the eight directions however, we can define gamepad A3 and A4 buttons (since the button mask pins are unused anyway), and define their usage in PS4 mode as sending touchpad left and touchpad right. this will allow us to simulate clicking the left vs. right sides of the touchpad, which will satisfy the PS1-on-PS4 emulation of the Start and Select buttons. A2 remains middle click.

This implements both A3 and A4 as direct GpioActions, i.e. mapping them to pins, and as hotkey actions, i.e. having a key combination to trigger them, the latter allowing the "known implementation" behavior for folks that want it that way, or have a button for them directly instead if so desired.

I will also use A3 and A4 later in the Generic HID implementation.

Resolves #924