Go to the documentation of this file.
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;
53 static int last_state;
67 data->custom_cursor = custom_cursor;
83 Android_CreateDefaultCursor()
100 if (!custom_cursor) {
104 return Android_WrapCursor(custom_cursor, 0);
110 return Android_WrapCursor(0,
id);
121 Android_CreateEmptyCursor()
127 empty_cursor = Android_CreateCursor(empty_surface, 0, 0);
135 Android_DestroyEmptyCursor()
138 Android_FreeCursor(empty_cursor);
147 cursor = Android_CreateEmptyCursor();
151 if (
data->custom_cursor) {
200 Android_DestroyEmptyCursor();
205 TranslateButton(
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_Mouse * SDL_GetMouse(void)
A collection of pixels used in software blitting.
#define SDL_ConvertSurfaceFormat
void Android_OnMouse(SDL_Window *window, int button, int action, float x, float y, SDL_bool relative)
int(* SetRelativeMouseMode)(SDL_bool enabled)
int Android_JNI_CreateCustomCursor(SDL_Surface *surface, int hot_x, int hot_y)
SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled)
void Android_InitMouse(void)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
The type used to identify a window.
GLint GLint GLint GLint GLint x
EGLSurface EGLNativeWindowType * window
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
#define SDL_BUTTON_MIDDLE
SDL_SystemCursor
Cursor types for SDL_CreateSystemCursor().
SDL_bool Android_JNI_SupportsRelativeMouse(void)
SDL_Cursor *(* CreateSystemCursor)(SDL_SystemCursor id)
@ SDL_PIXELFORMAT_ARGB8888
SDL_bool Android_JNI_SetCustomCursor(int cursorID)
SDL_bool Android_JNI_SetSystemCursor(int cursorID)
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
#define SDL_OutOfMemory()
int(* ShowCursor)(SDL_Cursor *cursor)
GLint GLint GLint GLint GLint GLint y
int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction)
void SDL_SetDefaultCursor(SDL_Cursor *cursor)
void(* FreeCursor)(SDL_Cursor *cursor)
SDL_Cursor *(* CreateCursor)(SDL_Surface *surface, int hot_x, int hot_y)
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define SDL_Unsupported()
@ SDL_SYSTEM_CURSOR_ARROW
void Android_QuitMouse(void)
#define SDL_CreateRGBSurfaceWithFormat
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)