SDL: Handle pen eraser button as a second button

From 0a5d2f3da216130f0c701317dd390431fbc557a0 Mon Sep 17 00:00:00 2001
From: Susko3 <[EMAIL REDACTED]>
Date: Sat, 4 Jan 2025 02:50:11 +0000
Subject: [PATCH] Handle pen eraser button as a second button

---
 src/video/windows/SDL_windowsevents.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 6c457eba5f14f..54609d03da9ad 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/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_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) {
             SDL_SendPenAxis(timestamp, pen, window, SDL_PEN_AXIS_PRESSURE, ((float) pen_info.pressure) / 1024.0f);  // pen_info.pressure is in the range 0..1024.