mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Fixed right click mouse emulation for the Wacom tablet
The problems are two-fold. When this happens a WM_POINTERDOWN event is sent with IS_POINTER_INCONTACT_WPARAM() evaluating as true. So when SDL_SendPenButton() is sent for the barrel button, there is no pen in contact yet, so the right mouse button is sent. Then SDL_SendPenTouch() is sent, which generates a left button press event. Fixes https://github.com/libsdl-org/SDL/issues/12926
This commit is contained in:
@@ -565,7 +565,7 @@ void SDL_SendPenButton(Uint64 timestamp, SDL_PenID instance_id, SDL_Window *wind
|
||||
event.pbutton.down = down;
|
||||
SDL_PushEvent(&event);
|
||||
|
||||
if (window && (pen_touching == instance_id)) {
|
||||
if (window && !pen_touching || (pen_touching == instance_id)) {
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
if (mouse && mouse->pen_mouse_events) {
|
||||
SDL_SendMouseButton(timestamp, window, SDL_PEN_MOUSEID, button + 1, down);
|
||||
|
@@ -1328,7 +1328,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
|
||||
const Uint64 timestamp = WIN_GetEventTimestamp();
|
||||
SDL_Window *window = data->window;
|
||||
|
||||
const bool istouching = IS_POINTER_INCONTACT_WPARAM(wParam);
|
||||
const bool istouching = IS_POINTER_INCONTACT_WPARAM(wParam) && IS_POINTER_FIRSTBUTTON_WPARAM(wParam);
|
||||
|
||||
// if lifting off, do it first, so any motion changes don't cause app issues.
|
||||
if (!istouching) {
|
||||
|
Reference in New Issue
Block a user