Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PS Vita touchpad ID after it has changed in SDL2 v2.30.7 #9307

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/engine/localevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,23 @@ namespace EventProcessing
static void onTouchEvent( LocalEvent & eventHandler, const SDL_TouchFingerEvent & event )
{
#if defined( TARGET_PS_VITA )
if ( event.touchId != 0 ) {
// Ignore rear touchpad on PS Vita
return;
{
// PS Vita has two touchpads: front and rear. The ID of the front touchpad must match the value of
// 'SDL_TouchID' used in the 'SDL_AddTouch()' call in the 'VITA_InitTouch()' function in this SDL2
// source file: video/vita/SDL_vitatouch.c.
constexpr SDL_TouchID frontTouchpadDeviceID
{
#if SDL_VERSION_ATLEAST( 2, 30, 7 )
1
#else
0
#endif
};

// Use only front touchpad on PS Vita.
if ( event.touchId != frontTouchpadDeviceID ) {
return;
}
}
#endif

Expand Down
Loading