From 3cee91973301cd61840f28e72e76c52e991fce49 Mon Sep 17 00:00:00 2001 From: LordCarve <27449516+LordCarve@users.noreply.github.com> Date: Mon, 11 May 2026 19:00:24 +0200 Subject: [PATCH] 14778 - Declare android helper before using it --- src/video/android/SDL_androidpen.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/video/android/SDL_androidpen.c b/src/video/android/SDL_androidpen.c index cfe091c009..acdf96d3ff 100644 --- a/src/video/android/SDL_androidpen.c +++ b/src/video/android/SDL_androidpen.c @@ -34,6 +34,20 @@ #define ACTION_HOVER_ENTER 9 #define ACTION_HOVER_EXIT 10 +/* +* Helper function to map android pen buttons to SDL mouse buttons +*/ +static inline Uint8 Android_PenToMouseButton(Uint8 pen_button) +{ + switch (pen_button) + { + case 1: return SDL_BUTTON_RIGHT; + case 2: return SDL_BUTTON_MIDDLE; + case 5: return 0; + default: return pen_button + 1; + } +} + void Android_OnPen(SDL_Window *window, int pen_id_in, SDL_PenDeviceType device_type, int button, int action, float x, float y, float p) { if (!window) { @@ -101,15 +115,4 @@ void Android_OnPen(SDL_Window *window, int pen_id_in, SDL_PenDeviceType device_t } } -static inline Uint8 Android_PenToMouseButton(Uint8 pen_button) -{ - switch (pen_button) - { - case 1: return SDL_BUTTON_RIGHT; - case 2: return SDL_BUTTON_MIDDLE; - case 5: return 0; - default: return pen_button + 1; - } -} - -#endif // SDL_VIDEO_DRIVER_ANDROID +#endif // SDL_VIDEO_DRIVER_ANDROID \ No newline at end of file