Bug 4576: remove touch/mouse duplication for WinRT

This commit is contained in:
Sylvain Becker 2019-04-02 17:13:22 +02:00
parent b086edc915
commit 42de5f97cc
1 changed files with 0 additions and 21 deletions

View File

@ -38,7 +38,6 @@ extern "C" {
/* File-specific globals: */ /* File-specific globals: */
static SDL_TouchID WINRT_TouchID = 1; static SDL_TouchID WINRT_TouchID = 1;
static unsigned int WINRT_LeftFingerDown = 0;
void void
@ -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 normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize); 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( SDL_SendTouch(
WINRT_TouchID, WINRT_TouchID,
(SDL_FingerID) pointerPoint->PointerId, (SDL_FingerID) pointerPoint->PointerId,
@ -263,10 +253,6 @@ WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPo
if ( ! WINRT_IsTouchEvent(pointerPoint)) { if ( ! WINRT_IsTouchEvent(pointerPoint)) {
SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y); SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
} else { } else {
if (pointerPoint->PointerId == WINRT_LeftFingerDown) {
SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y);
}
SDL_SendTouchMotion( SDL_SendTouchMotion(
WINRT_TouchID, WINRT_TouchID,
(SDL_FingerID) pointerPoint->PointerId, (SDL_FingerID) pointerPoint->PointerId,
@ -289,13 +275,6 @@ void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::P
} else { } else {
Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne); 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( SDL_SendTouch(
WINRT_TouchID, WINRT_TouchID,
(SDL_FingerID) pointerPoint->PointerId, (SDL_FingerID) pointerPoint->PointerId,