14778 - Declare android helper before using it

This commit is contained in:
LordCarve 2026-05-11 19:00:24 +02:00
parent 2766378cf2
commit 3cee919733

View file

@ -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