22#include "../../SDL_internal.h"
24#if SDL_VIDEO_DRIVER_ANDROID
29#include "../../events/SDL_mouse_c.h"
31#include "../../core/android/SDL_android.h"
37#define ACTION_HOVER_MOVE 7
38#define ACTION_SCROLL 8
39#define BUTTON_PRIMARY 1
40#define BUTTON_SECONDARY 2
41#define BUTTON_TERTIARY 4
43#define BUTTON_FORWARD 16
50} SDL_AndroidCursorData;
67 data->custom_cursor = custom_cursor;
83Android_CreateDefaultCursor()
100 if (!custom_cursor) {
104 return Android_WrapCursor(custom_cursor, 0);
110 return Android_WrapCursor(0,
id);
121Android_CreateEmptyCursor()
127 empty_cursor = Android_CreateCursor(empty_surface, 0, 0);
135Android_DestroyEmptyCursor()
138 Android_FreeCursor(empty_cursor);
147 cursor = Android_CreateEmptyCursor();
151 if (
data->custom_cursor) {
200 Android_DestroyEmptyCursor();
205TranslateButton(
int state)
207 if (
state & BUTTON_PRIMARY) {
209 }
else if (
state & BUTTON_SECONDARY) {
211 }
else if (
state & BUTTON_TERTIARY) {
213 }
else if (
state & BUTTON_FORWARD) {
215 }
else if (
state & BUTTON_BACK) {
234 changes =
state & ~last_state;
235 button = TranslateButton(changes);
242 changes = last_state & ~state;
243 button = TranslateButton(changes);
250 case ACTION_HOVER_MOVE:
SDL_bool Android_JNI_SupportsRelativeMouse(void)
SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled)
SDL_bool Android_JNI_SetCustomCursor(int cursorID)
SDL_bool Android_JNI_SetSystemCursor(int cursorID)
int Android_JNI_CreateCustomCursor(SDL_Surface *surface, int hot_x, int hot_y)
void Android_OnMouse(SDL_Window *window, int button, int action, float x, float y, SDL_bool relative)
void Android_QuitMouse(void)
void Android_InitMouse(void)
#define SDL_ConvertSurfaceFormat
#define SDL_CreateRGBSurfaceWithFormat
#define SDL_OutOfMemory()
#define SDL_Unsupported()
int uint32_t uint32_t uint32_t uint32_t uint32_t int drmModeModeInfoPtr mode int uint32_t uint32_t uint32_t uint32_t int32_t hot_x
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
void SDL_SetDefaultCursor(SDL_Cursor *cursor)
SDL_Mouse * SDL_GetMouse(void)
int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction)
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
SDL_SystemCursor
Cursor types for SDL_CreateSystemCursor().
@ SDL_SYSTEM_CURSOR_ARROW
#define SDL_BUTTON_MIDDLE
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLint GLint GLint x
GLenum GLenum GLsizei const GLuint GLboolean enabled
@ SDL_PIXELFORMAT_ARGB8888
EGLSurface EGLNativeWindowType * window
int(* SetRelativeMouseMode)(SDL_bool enabled)
void(* FreeCursor)(SDL_Cursor *cursor)
int(* ShowCursor)(SDL_Cursor *cursor)
SDL_Cursor *(* CreateSystemCursor)(SDL_SystemCursor id)
SDL_Cursor *(* CreateCursor)(SDL_Surface *surface, int hot_x, int hot_y)
A collection of pixels used in software blitting.
The type used to identify a window.