Navigation Menu

Skip to content

Commit

Permalink
Bug 4576: remove touch/mouse duplication for WinRT
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Apr 2, 2019
1 parent b086edc commit 42de5f9
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/video/winrt/SDL_winrtpointerinput.cpp
Expand Up @@ -38,7 +38,6 @@ extern "C" {

/* File-specific globals: */
static SDL_TouchID WINRT_TouchID = 1;
static unsigned int WINRT_LeftFingerDown = 0;


void
Expand Down Expand Up @@ -231,15 +230,6 @@ void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::Po
Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize);

if (!WINRT_LeftFingerDown) {
if (button) {
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y);
SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, button);
}

WINRT_LeftFingerDown = pointerPoint->PointerId;
}

SDL_SendTouch(
WINRT_TouchID,
(SDL_FingerID) pointerPoint->PointerId,
Expand All @@ -263,10 +253,6 @@ WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPo
if ( ! WINRT_IsTouchEvent(pointerPoint)) {
SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
} else {
if (pointerPoint->PointerId == WINRT_LeftFingerDown) {
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y);
}

SDL_SendTouchMotion(
WINRT_TouchID,
(SDL_FingerID) pointerPoint->PointerId,
Expand All @@ -289,13 +275,6 @@ void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::P
} else {
Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);

if (WINRT_LeftFingerDown == pointerPoint->PointerId) {
if (button) {
SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_RELEASED, button);
}
WINRT_LeftFingerDown = 0;
}

SDL_SendTouch(
WINRT_TouchID,
(SDL_FingerID) pointerPoint->PointerId,
Expand Down

0 comments on commit 42de5f9

Please sign in to comment.