Browse Source

wayland: Fixed pen button input (was losing button up events).

Ryan C. Gordon 3 weeks ago
parent
commit
0cc3354731
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/video/wayland/SDL_waylandevents.c

+ 1 - 1
src/video/wayland/SDL_waylandevents.c

@@ -3408,7 +3408,7 @@ static void tablet_tool_handle_button(void *data, struct zwp_tablet_tool_v2 *too
     }
     }
 
 
     SDL_assert((sdlbutton >= 1) && (sdlbutton <= SDL_arraysize(sdltool->frame.buttons)));
     SDL_assert((sdlbutton >= 1) && (sdlbutton <= SDL_arraysize(sdltool->frame.buttons)));
-    sdltool->frame.buttons[sdlbutton-1] = (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED) ? 1 : 0;
+    sdltool->frame.buttons[sdlbutton-1] = (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED) ? WAYLAND_TABLET_TOOL_BUTTON_DOWN : WAYLAND_TABLET_TOOL_BUTTON_UP;
 }
 }
 
 
 static void tablet_tool_handle_rotation(void *data, struct zwp_tablet_tool_v2 *tool, wl_fixed_t degrees)
 static void tablet_tool_handle_rotation(void *data, struct zwp_tablet_tool_v2 *tool, wl_fixed_t degrees)