Feature: Native 1:1 PS4 Touchpad Mapping for DS Touchscreen#2682
Open
Appltron wants to merge 4 commits into
Open
Feature: Native 1:1 PS4 Touchpad Mapping for DS Touchscreen#2682Appltron wants to merge 4 commits into
Appltron wants to merge 4 commits into
Conversation
asiekierka
reviewed
Jun 5, 2026
| { | ||
| printf("SDL couldn't init rumble\n"); | ||
| } | ||
| SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1"); |
Contributor
There was a problem hiding this comment.
This is redundant. The default is the value of [SDL_HINT_JOYSTICK_HIDAPI](https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI) => "1": HIDAPI drivers are used (the default).
Author
There was a problem hiding this comment.
Thank you for pointing this out. I was unaware it was the default behavior. I have removed the redundant line in the latest commit.
asiekierka
reviewed
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Concept
Playing touch-heavy games on a monitor can feel clunky when using a mouse to mimic quick stylus taps. This PR introduces native, absolute 1:1 coordinate mapping using a DualShock 4 controller's built-in touchpad via Bluetooth.
This implementation takes heavy inspiration from 3DS emulation fork Azahar, which has proven how seamless and natural absolute touchpad integration feels for dual-screen emulation.
Implementation Details
Instead of building a complex event loop, this leverages SDL2's internal state tracker directly within the EmuThread.cpp loop, right before emuInstance->isTouching is evaluated:
Testing Environment
A Note on Development
Transparency note: I am not a career C++ software engineer, so I utilized an AI assistant to help draft the precise SDL2 API calls and coordinate math. However, I have fully compiled the source code from scratch, resolved the MSYS2 toolchain dependencies, and extensively tested the compiled .exe on hardware to verify the touch inputs register flawlessly without performance dips.