Browse Source

Handle pen eraser button as a second button

Susko3 7 months ago
parent
commit
0a5d2f3da2
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/video/windows/SDL_windowsevents.c

+ 1 - 0
src/video/windows/SDL_windowsevents.c

@@ -1220,6 +1220,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
 
 
         SDL_SendPenMotion(timestamp, pen, window, (float) position.x, (float) position.y);
         SDL_SendPenMotion(timestamp, pen, window, (float) position.x, (float) position.y);
         SDL_SendPenButton(timestamp, pen, window, 1, (pen_info.penFlags & PEN_FLAG_BARREL) != 0);
         SDL_SendPenButton(timestamp, pen, window, 1, (pen_info.penFlags & PEN_FLAG_BARREL) != 0);
+        SDL_SendPenButton(timestamp, pen, window, 2, (pen_info.penFlags & PEN_FLAG_ERASER) != 0);
 
 
         if (pen_info.penMask & PEN_MASK_PRESSURE) {
         if (pen_info.penMask & PEN_MASK_PRESSURE) {
             SDL_SendPenAxis(timestamp, pen, window, SDL_PEN_AXIS_PRESSURE, ((float) pen_info.pressure) / 1024.0f);  // pen_info.pressure is in the range 0..1024.
             SDL_SendPenAxis(timestamp, pen, window, SDL_PEN_AXIS_PRESSURE, ((float) pen_info.pressure) / 1024.0f);  // pen_info.pressure is in the range 0..1024.