Pass the OS event timestamp for keyboard, mouse, and touch events where possible
Currently implemented for Windows and Apple platforms
This commit is contained in:
@@ -254,12 +254,12 @@ class SDL_BApp : public BApplication
|
||||
SDL_GetWindowPosition(win, &winPosX, &winPosY);
|
||||
int dx = x - (winWidth / 2);
|
||||
int dy = y - (winHeight / 2);
|
||||
SDL_SendMouseMotion(win, 0, SDL_GetMouse()->relative_mode, dx, dy);
|
||||
SDL_SendMouseMotion(0, win, 0, SDL_GetMouse()->relative_mode, dx, dy);
|
||||
set_mouse_position((winPosX + winWidth / 2), (winPosY + winHeight / 2));
|
||||
if (!be_app->IsCursorHidden())
|
||||
be_app->HideCursor();
|
||||
} else {
|
||||
SDL_SendMouseMotion(win, 0, 0, x, y);
|
||||
SDL_SendMouseMotion(0, win, 0, 0, x, y);
|
||||
if (SDL_ShowCursor(-1) && be_app->IsCursorHidden())
|
||||
be_app->ShowCursor();
|
||||
}
|
||||
@@ -277,7 +277,7 @@ class SDL_BApp : public BApplication
|
||||
return;
|
||||
}
|
||||
win = GetSDLWindow(winID);
|
||||
SDL_SendMouseButton(win, 0, state, button);
|
||||
SDL_SendMouseButton(0, win, 0, state, button);
|
||||
}
|
||||
|
||||
void _HandleMouseWheel(BMessage *msg)
|
||||
@@ -292,7 +292,7 @@ class SDL_BApp : public BApplication
|
||||
return;
|
||||
}
|
||||
win = GetSDLWindow(winID);
|
||||
SDL_SendMouseWheel(win, 0, xTicks, -yTicks, SDL_MOUSEWHEEL_NORMAL);
|
||||
SDL_SendMouseWheel(0, win, 0, xTicks, -yTicks, SDL_MOUSEWHEEL_NORMAL);
|
||||
}
|
||||
|
||||
void _HandleKey(BMessage *msg)
|
||||
@@ -309,7 +309,7 @@ class SDL_BApp : public BApplication
|
||||
return;
|
||||
}
|
||||
HAIKU_SetKeyState(scancode, state);
|
||||
SDL_SendKeyboardKey(state, HAIKU_GetScancodeFromBeKey(scancode));
|
||||
SDL_SendKeyboardKey(0, state, HAIKU_GetScancodeFromBeKey(scancode));
|
||||
|
||||
if (state == SDL_PRESSED && SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
|
||||
const int8 *keyUtf8;
|
||||
|
||||
Reference in New Issue
Block a user