Platform specific API documentation generation.
This commit is contained in:
@@ -7,22 +7,22 @@ static void platformDefineGlobals() {
|
||||
lua_State *L = state->luaState;
|
||||
|
||||
lua_getglobal( L, "RL" );
|
||||
|
||||
/* KeyboardKey */
|
||||
/*DOC_DEFINES_START*/
|
||||
/* Keyboard keys (US keyboard layout) */
|
||||
assignGlobalInt( GLFW_KEY_UNKNOWN, "GLFW_KEY_UNKNOWN" ); // Key: Unknown
|
||||
/* GLFW API tokens. */
|
||||
/* GLFW API tokens. */
|
||||
assignGlobalInt( GLFW_RELEASE, "GLFW_RELEASE" ); // The key or mouse button was released
|
||||
assignGlobalInt( GLFW_PRESS, "GLFW_PRESS" ); // The key or mouse button was pressed
|
||||
assignGlobalInt( GLFW_REPEAT, "GLFW_REPEAT" ); // The key was held down until it repeated
|
||||
assignGlobalInt( GLFW_CONNECTED, "GLFW_CONNECTED" ); // Joystick connected
|
||||
assignGlobalInt( GLFW_DISCONNECTED, "GLFW_DISCONNECTED" ); // Joystick disconnected
|
||||
/* Window Events. */
|
||||
/* GLFW Window Events. */
|
||||
assignGlobalInt( GLFW_WINDOW_SIZE_EVENT, "GLFW_WINDOW_SIZE_EVENT" ); // GLFW event window size changed
|
||||
assignGlobalInt( GLFW_WINDOW_MAXIMIZE_EVENT, "GLFW_WINDOW_MAXIMIZE_EVENT" ); // GLFW event window maximize
|
||||
assignGlobalInt( GLFW_WINDOW_ICONYFY_EVENT, "GLFW_WINDOW_ICONYFY_EVENT" ); // GLFW event window iconify
|
||||
assignGlobalInt( GLFW_WINDOW_FOCUS_EVENT, "GLFW_WINDOW_FOCUS_EVENT" ); // GLFW event window focus
|
||||
assignGlobalInt( GLFW_WINDOW_DROP_EVENT, "GLFW_WINDOW_DROP_EVENT" ); // GLFW event window drop
|
||||
/* Input Events. */
|
||||
/* GLFW Input Events. */
|
||||
assignGlobalInt( GLFW_KEY_EVENT, "GLFW_KEY_EVENT" ); // GLFW event keyboard key
|
||||
assignGlobalInt( GLFW_CHAR_EVENT, "GLFW_CHAR_EVENT" ); // GLFW event Unicode character
|
||||
assignGlobalInt( GLFW_MOUSE_BUTTON_EVENT, "GLFW_MOUSE_BUTTON_EVENT" ); // GLFW event mouse button
|
||||
@@ -30,31 +30,24 @@ static void platformDefineGlobals() {
|
||||
assignGlobalInt( GLFW_MOUSE_SCROLL_EVENT, "GLFW_MOUSE_SCROLL_EVENT" ); // GLFW event mouse scroll
|
||||
assignGlobalInt( GLFW_CURSOR_ENTER_EVENT, "GLFW_CURSOR_ENTER_EVENT" ); // GLFW event cursor enter/leave
|
||||
assignGlobalInt( GLFW_JOYSTICK_EVENT, "GLFW_JOYSTICK_EVENT" ); // GLFW event joystick
|
||||
/* Pen Tablet Events. NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445. */
|
||||
/* GLFW Pen Tablet Events. NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445. */
|
||||
// assignGlobalInt( GLFW_PEN_TABLET_DATA_EVENT, "GLFW_PEN_TABLET_DATA_EVENT" ); // GLFW event pen tablet data
|
||||
// assignGlobalInt( GLFW_PEN_TABLET_CURSOR_EVENT, "GLFW_PEN_TABLET_CURSOR_EVENT" ); // GLFW event pen tablet cursor
|
||||
// assignGlobalInt( GLFW_PEN_TABLET_PROXIMITY_EVENT, "GLFW_PEN_TABLET_PROXIMITY_EVENT" ); // GLFW event pen tablet proximity
|
||||
|
||||
/*DOC_DEFINES_END*/
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/* Functions. */
|
||||
|
||||
/*
|
||||
## Core - Input-related functions: keyboard.
|
||||
## GLFW Core - Input-related functions: keyboard
|
||||
*/
|
||||
|
||||
/*
|
||||
> keyName = RL.GetKeyName( int key, int scancode )
|
||||
|
||||
This function returns the name of the specified printable key, encoded as UTF-8.
|
||||
This is typically the character that key would produce without any modifier keys,
|
||||
intended for displaying key bindings to the user. For dead keys, it is typically
|
||||
the diacritic it would add to a character.
|
||||
|
||||
Do not use this function for text input. You will break text input for many
|
||||
languages even if it happens to work for yours.
|
||||
|
||||
If the key is KEY_UNKNOWN, the scancode is used to identify the key,
|
||||
otherwise the scancode is ignored. If you specify a non-printable key,
|
||||
or KEY_UNKNOWN and a scancode that maps to a non-printable key,
|
||||
@@ -107,8 +100,15 @@ static void luaPlatformRegister() {
|
||||
|
||||
/* Events. */
|
||||
|
||||
/* Window events. */
|
||||
/*
|
||||
## Window events
|
||||
*/
|
||||
|
||||
/*
|
||||
> GLFWwindowsizeEvent = { int type, int width, int height }
|
||||
|
||||
Called when the window is resized. Type GLFW_WINDOW_SIZE_EVENT
|
||||
*/
|
||||
static void windowSizeEvent( GLFWwindow *window, int width, int height ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibWindowSizeCallback( window, width, height );
|
||||
@@ -140,6 +140,11 @@ static void windowSizeEvent( GLFWwindow *window, int width, int height ) {
|
||||
|
||||
#if !defined( PLATFORM_WEB )
|
||||
|
||||
/*
|
||||
> GLFWwindowmaximizeEvent = { int type, int maximized }
|
||||
|
||||
Called when the window is maximized or restored. Type GLFW_WINDOW_MAXIMIZE_EVENT
|
||||
*/
|
||||
static void windowMaximizeEvent( GLFWwindow *window, int maximized ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibWindowMaximizeCallback( window, maximized );
|
||||
@@ -169,6 +174,11 @@ static void windowMaximizeEvent( GLFWwindow *window, int maximized ) {
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
> GLFWwindowiconifyEvent = { int type, int iconified }
|
||||
|
||||
Called when the window is iconified or restored. Type GLFW_WINDOW_ICONYFY_EVENT
|
||||
*/
|
||||
static void windowIconyfyEvent( GLFWwindow *window, int iconified ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibWindowIconifyCallback( window, iconified );
|
||||
@@ -196,6 +206,11 @@ static void windowIconyfyEvent( GLFWwindow *window, int iconified ) {
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
> GLFWwindowfocusEvent = { int type, int focused }
|
||||
|
||||
Called when the window gains or loses input focus. Type GLFW_WINDOW_FOCUS_EVENT
|
||||
*/
|
||||
static void windowFocusEvent( GLFWwindow *window, int focused ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibWindowFocusCallback( window, focused );
|
||||
@@ -223,6 +238,11 @@ static void windowFocusEvent( GLFWwindow *window, int focused ) {
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
> GLFWdropEvent = { int type, int count, string{} paths }
|
||||
|
||||
Called when files are dropped to the window. Type GLFW_WINDOW_DROP_EVENT
|
||||
*/
|
||||
static void windowDropEvent( GLFWwindow *window, int count, const char **paths ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibWindowDropCallback( window, count, paths );
|
||||
@@ -258,8 +278,15 @@ static void windowDropEvent( GLFWwindow *window, int count, const char **paths )
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/* Input events. */
|
||||
/*
|
||||
## Input events
|
||||
*/
|
||||
|
||||
/*
|
||||
> GLFWkeyEvent = { int type, int key, int scancode, int action, int mods }
|
||||
|
||||
Called when a physical key is pressed or released or when it repeats. Type GLFW_KEY_EVENT
|
||||
*/
|
||||
static void keyInputEvent( GLFWwindow* window, int key, int scancode, int action, int mods ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibKeyCallback( window, key, scancode, action, mods );
|
||||
@@ -293,6 +320,11 @@ static void keyInputEvent( GLFWwindow* window, int key, int scancode, int action
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
> GLFWcharEvent = { int type, int key }
|
||||
|
||||
Unicode code points for key events that would have led to regular text input and generally behaves as a standard text field on that platform. Type GLFW_CHAR_EVENT
|
||||
*/
|
||||
static void charInputEvent( GLFWwindow* window, unsigned int key ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibCharCallback( window, key );
|
||||
@@ -320,6 +352,11 @@ static void charInputEvent( GLFWwindow* window, unsigned int key ) {
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
> GLFWmousebuttonEvent = { int type, int button, int action, int mods }
|
||||
|
||||
Called when a mouse button is pressed or released. Type GLFW_MOUSE_BUTTON_EVENT
|
||||
*/
|
||||
static void mouseButtonInputEvent( GLFWwindow* window, int button, int action, int mods ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibMouseButtonCallback( window, button, action, mods );
|
||||
@@ -351,6 +388,11 @@ static void mouseButtonInputEvent( GLFWwindow* window, int button, int action, i
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
> GLFWcursorposEvent = { int type, float x, float y }
|
||||
|
||||
Called when the cursor moves over the window. Type GLFW_MOUSE_CURSOR_POS_EVENT
|
||||
*/
|
||||
static void mouseCursorPosInputEvent( GLFWwindow* window, double x, double y ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibMouseCursorPosCallback( window, x, y );
|
||||
@@ -380,6 +422,11 @@ static void mouseCursorPosInputEvent( GLFWwindow* window, double x, double y ) {
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
> GLFWscrollEvent = { int type, float xoffset, float yoffset }
|
||||
|
||||
Called when the user scrolls, whether with a mouse wheel or touchpad gesture. Type GLFW_MOUSE_SCROLL_EVENT
|
||||
*/
|
||||
static void mouseScrollInputEvent( GLFWwindow* window, double xoffset, double yoffset ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibMouseScrollCallback( window, xoffset, yoffset );
|
||||
@@ -409,6 +456,11 @@ static void mouseScrollInputEvent( GLFWwindow* window, double xoffset, double yo
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
> GLFWcursorenterEvent = { int type, int enter }
|
||||
|
||||
Called when the cursor enters or leaves the content area of a window. Type GLFW_CURSOR_ENTER_EVENT
|
||||
*/
|
||||
static void cursorEnterInputEvent( GLFWwindow* window, int enter ) {
|
||||
/* Pass through to raylib callback. */
|
||||
state->raylibCursorEnterCallback( window, enter );
|
||||
@@ -436,7 +488,12 @@ static void cursorEnterInputEvent( GLFWwindow* window, int enter ) {
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
static void joystickInputEvent( int jid, int event ) {
|
||||
/*
|
||||
> GLFWjoystickEvent = { int type, int jid, int event }
|
||||
|
||||
Called when a joystick is connected or disconnected. Type GLFW_JOYSTICK_EVENT
|
||||
*/
|
||||
static void joystickEvent( int jid, int event ) {
|
||||
/* Pass through to raylib callback. */
|
||||
if ( state->raylibJoystickCallback != NULL ) {
|
||||
state->raylibJoystickCallback( jid, event );
|
||||
@@ -467,7 +524,12 @@ static void joystickInputEvent( int jid, int event ) {
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
// /* NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 */
|
||||
/*
|
||||
> GLFWpentabletdataEvent = { int type, float x, float y, float z, float pressure, float pitch, float yaw, float roll }
|
||||
|
||||
Called when the pen tablet data is updated. Type GLFW_PEN_TABLET_DATA_EVENT
|
||||
NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445
|
||||
*/
|
||||
// static void penTabletDataEvent( double x, double y, double z, double pressure, double pitch, double yaw, double roll ) {
|
||||
// lua_State *L = state->luaState;
|
||||
|
||||
@@ -504,7 +566,12 @@ static void joystickInputEvent( int jid, int event ) {
|
||||
// lua_pop( L, -1 );
|
||||
// }
|
||||
|
||||
// /* NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 */
|
||||
/*
|
||||
> GLFWpentabletcursorEvent = { int type, int identifier }
|
||||
|
||||
Called when the pen tablet cursor has changed. Type GLFW_PEN_TABLET_CURSOR_EVENT
|
||||
NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445
|
||||
*/
|
||||
// static void penTabletCursorEvent( unsigned int identifier ) {
|
||||
// lua_State *L = state->luaState;
|
||||
|
||||
@@ -529,7 +596,12 @@ static void joystickInputEvent( int jid, int event ) {
|
||||
// lua_pop( L, -1 );
|
||||
// }
|
||||
|
||||
// /* NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 */
|
||||
/*
|
||||
> GLFWpentabletproximityEvent = { int type, int proxState }
|
||||
|
||||
Called when the pen tablet proximity has changed. Type GLFW_PEN_TABLET_PROXIMITY_EVENT
|
||||
NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445
|
||||
*/
|
||||
// static void penTabletProximityEvent( int proxState ) {
|
||||
// lua_State *L = state->luaState;
|
||||
|
||||
@@ -571,7 +643,7 @@ static void platformRegisterEvents() {
|
||||
state->raylibMouseCursorPosCallback = glfwSetCursorPosCallback( GetWindowHandle(), mouseCursorPosInputEvent );
|
||||
state->raylibMouseScrollCallback = glfwSetScrollCallback( GetWindowHandle(), mouseScrollInputEvent );
|
||||
state->raylibCursorEnterCallback = glfwSetCursorEnterCallback( GetWindowHandle(), cursorEnterInputEvent );
|
||||
state->raylibJoystickCallback = glfwSetJoystickCallback( joystickInputEvent );
|
||||
state->raylibJoystickCallback = glfwSetJoystickCallback( joystickEvent );
|
||||
/* NOTE! Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 */
|
||||
// state->glfwtabletDataCallback = glfwSetPenTabletDataCallback( penTabletDataEvent );
|
||||
// state->glfwtabletCursorCallback = glfwSetPenTabletCursorCallback( penTabletCursorEvent );
|
||||
|
||||
@@ -7,18 +7,18 @@ static void platformDefineGlobals() {
|
||||
lua_State *L = state->luaState;
|
||||
|
||||
lua_getglobal( L, "RL" );
|
||||
|
||||
/* KeyboardEvents */
|
||||
/*DOC_DEFINES_START*/
|
||||
/* Keyboard events */
|
||||
assignGlobalInt( SDL_KEYDOWN, "SDL_KEYDOWN" ); // Key pressed
|
||||
assignGlobalInt( SDL_KEYUP, "SDL_KEYUP" ); // Key released
|
||||
/* WindowEvents */
|
||||
/* Window events */
|
||||
assignGlobalInt( SDL_WINDOWEVENT, "SDL_WINDOWEVENT" ); // Window state change
|
||||
/* MouseEvents */
|
||||
/* Mouse events */
|
||||
assignGlobalInt( SDL_MOUSEMOTION, "SDL_MOUSEMOTION" ); // Mouse moved
|
||||
assignGlobalInt( SDL_MOUSEBUTTONDOWN, "SDL_MOUSEBUTTONDOWN" ); // Mouse button pressed
|
||||
assignGlobalInt( SDL_MOUSEBUTTONUP, "SDL_MOUSEBUTTONUP" ); // Mouse button released
|
||||
assignGlobalInt( SDL_MOUSEWHEEL, "SDL_MOUSEWHEEL" ); // Mouse wheel motion
|
||||
/* JoystickEvents */
|
||||
/* Joystick events */
|
||||
assignGlobalInt( SDL_JOYAXISMOTION, "SDL_JOYAXISMOTION" ); // Joystick axis motion
|
||||
assignGlobalInt( SDL_JOYBALLMOTION, "SDL_JOYBALLMOTION" ); // Joystick trackball motion
|
||||
assignGlobalInt( SDL_JOYHATMOTION, "SDL_JOYHATMOTION" );
|
||||
@@ -26,22 +26,22 @@ static void platformDefineGlobals() {
|
||||
assignGlobalInt( SDL_JOYBUTTONUP, "SDL_JOYBUTTONUP" ); // Joystick button released
|
||||
assignGlobalInt( SDL_JOYDEVICEADDED, "SDL_JOYDEVICEADDED" ); // Joystick connected
|
||||
assignGlobalInt( SDL_JOYDEVICEREMOVED, "SDL_JOYDEVICEREMOVED" ); // Joystick disconnected
|
||||
/* ControllerEvents */
|
||||
/* Controller events */
|
||||
assignGlobalInt( SDL_CONTROLLERAXISMOTION, "SDL_CONTROLLERAXISMOTION" ); // Controller axis motion
|
||||
assignGlobalInt( SDL_CONTROLLERBUTTONDOWN, "SDL_CONTROLLERBUTTONDOWN" ); // Controller button pressed
|
||||
assignGlobalInt( SDL_CONTROLLERBUTTONUP, "SDL_CONTROLLERBUTTONUP" ); // Controller button released
|
||||
assignGlobalInt( SDL_CONTROLLERDEVICEADDED, "SDL_CONTROLLERDEVICEADDED" ); // Controller connected
|
||||
assignGlobalInt( SDL_CONTROLLERDEVICEREMOVED, "SDL_CONTROLLERDEVICEREMOVED" ); // Controller disconnected
|
||||
assignGlobalInt( SDL_CONTROLLERDEVICEREMAPPED, "SDL_CONTROLLERDEVICEREMAPPED" ); // Controller mapping updated
|
||||
/* TouchEvents */
|
||||
/* Touch events */
|
||||
assignGlobalInt( SDL_FINGERDOWN, "SDL_FINGERDOWN" ); // User has touched input device
|
||||
assignGlobalInt( SDL_FINGERUP, "SDL_FINGERUP" ); // User stopped touching input device
|
||||
assignGlobalInt( SDL_FINGERMOTION, "SDL_FINGERMOTION" ); // User is dragging finger on input device
|
||||
/* GestureEvents */
|
||||
/* Gesture events */
|
||||
assignGlobalInt( SDL_DOLLARGESTURE, "SDL_DOLLARGESTURE" );
|
||||
assignGlobalInt( SDL_DOLLARRECORD, "SDL_DOLLARRECORD" );
|
||||
assignGlobalInt( SDL_MULTIGESTURE, "SDL_MULTIGESTURE" );
|
||||
/* WindowEventIDs */
|
||||
/* Window states */
|
||||
assignGlobalInt( SDL_WINDOWEVENT_SHOWN, "SDL_WINDOWEVENT_SHOWN" );
|
||||
assignGlobalInt( SDL_WINDOWEVENT_HIDDEN, "SDL_WINDOWEVENT_HIDDEN" );
|
||||
assignGlobalInt( SDL_WINDOWEVENT_EXPOSED, "SDL_WINDOWEVENT_EXPOSED" );
|
||||
@@ -58,10 +58,10 @@ static void platformDefineGlobals() {
|
||||
assignGlobalInt( SDL_WINDOWEVENT_CLOSE, "SDL_WINDOWEVENT_CLOSE" );
|
||||
assignGlobalInt( SDL_WINDOWEVENT_TAKE_FOCUS, "SDL_WINDOWEVENT_TAKE_FOCUS" );
|
||||
assignGlobalInt( SDL_WINDOWEVENT_HIT_TEST, "SDL_WINDOWEVENT_HIT_TEST" );
|
||||
/* KeyboardAndMouseState */
|
||||
/* Keyboard and mouse states */
|
||||
assignGlobalInt( SDL_RELEASED, "SDL_RELEASED" );
|
||||
assignGlobalInt( SDL_PRESSED, "SDL_PRESSED" );
|
||||
/* JoystickHatMotion */
|
||||
/* Joystick hat motion */
|
||||
assignGlobalInt( SDL_HAT_LEFTUP, "SDL_HAT_LEFTUP" );
|
||||
assignGlobalInt( SDL_HAT_UP, "SDL_HAT_UP" );
|
||||
assignGlobalInt( SDL_HAT_RIGHTUP, "SDL_HAT_RIGHTUP" );
|
||||
@@ -71,14 +71,14 @@ static void platformDefineGlobals() {
|
||||
assignGlobalInt( SDL_HAT_LEFTDOWN, "SDL_HAT_LEFTDOWN" );
|
||||
assignGlobalInt( SDL_HAT_DOWN, "SDL_HAT_DOWN" );
|
||||
assignGlobalInt( SDL_HAT_RIGHTDOWN, "SDL_HAT_RIGHTDOWN" );
|
||||
|
||||
/*DOC_DEFINES_END*/
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
/* Functions. */
|
||||
|
||||
/*
|
||||
## Core - Input-related functions: keyboard.
|
||||
## SDL Core - Input-related functions: keyboard.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -124,6 +124,10 @@ static void luaPlatformRegister() {
|
||||
|
||||
/* Events. */
|
||||
|
||||
/*
|
||||
## SDL Events
|
||||
*/
|
||||
|
||||
/* This function is not thread safe so we don't use Lua inside it directly. It only adds events to another queue. */
|
||||
static int SDLEventFilter( void *userdata, SDL_Event *event ) {
|
||||
/* SDL_EVENT_POLL_SENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
|
||||
@@ -163,6 +167,11 @@ static void platformSendEvents() {
|
||||
SDL_Event event = state->SDL_eventQueue[i];
|
||||
|
||||
switch ( event.type ) {
|
||||
/*
|
||||
> SDL_KeyboardEvent = { int type, int timestamp, int state, int repeat, int scancode, int sym, int mod }
|
||||
|
||||
Event occurs whenever a user presses or releases a button on a keyboard. Type SDL_KEYUP or SDL_KEYDOWN
|
||||
*/
|
||||
case SDL_KEYUP:
|
||||
case SDL_KEYDOWN:
|
||||
{
|
||||
@@ -184,6 +193,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_WindowEvent = { int type, int timestamp, int event, int data1, int data2 }
|
||||
|
||||
Event occurs when an event of type SDL_WINDOWEVENT is reported. Type SDL_WINDOWEVENT
|
||||
*/
|
||||
case SDL_WINDOWEVENT:
|
||||
{
|
||||
lua_createtable( L, 5, 0 );
|
||||
@@ -200,6 +214,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_MouseMotionEvent = { int type, int timestamp, int which, int state, int x, int y, int xrel, int yrel }
|
||||
|
||||
Event occurs whenever a user moves the mouse within the application window or when SDL_WarpMouseInWindow() is called. Type SDL_MOUSEMOTION
|
||||
*/
|
||||
case SDL_MOUSEMOTION:
|
||||
{
|
||||
lua_createtable( L, 8, 0 );
|
||||
@@ -222,6 +241,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_MouseButtonEvent = { int type, int timestamp, int which, int button, int state, int x, int y }
|
||||
|
||||
Event occurs whenever a user presses or releases a button on a mouse. Type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
|
||||
*/
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
{
|
||||
@@ -243,6 +267,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_MouseWheelEvent = { int type, int timestamp, int which, int x, int y }
|
||||
|
||||
Event occurs whenever a user moves the mouse wheel. Type SDL_MOUSEWHEEL
|
||||
*/
|
||||
case SDL_MOUSEWHEEL:
|
||||
{
|
||||
lua_createtable( L, 5, 0 );
|
||||
@@ -259,6 +288,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_JoyAxisEvent = { int type, int timestamp, int which, int axis, int value }
|
||||
|
||||
Event occurs whenever a user moves an axis on the joystick. Type SDL_JOYAXISMOTION
|
||||
*/
|
||||
case SDL_JOYAXISMOTION:
|
||||
{
|
||||
lua_createtable( L, 5, 0 );
|
||||
@@ -275,6 +309,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_JoyBallEvent = { int type, int timestamp, int which, int ball, int xrel, int yrel }
|
||||
|
||||
Event occurs when a user moves a trackball on the joystick. Type SDL_JOYBALLMOTION
|
||||
*/
|
||||
case SDL_JOYBALLMOTION:
|
||||
{
|
||||
lua_createtable( L, 6, 0 );
|
||||
@@ -293,6 +332,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_JoyHatEvent = { int type, int timestamp, int which, int hat, int value }
|
||||
|
||||
Event occurs whenever a user moves a hat on the joystick. Type SDL_JOYHATMOTION
|
||||
*/
|
||||
case SDL_JOYHATMOTION:
|
||||
{
|
||||
lua_createtable( L, 5, 0 );
|
||||
@@ -309,6 +353,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_JoyButtonEvent = { int type, int timestamp, int which, int button, int state }
|
||||
|
||||
Event occurs whenever a user presses or releases a button on a joystick. Type SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP
|
||||
*/
|
||||
case SDL_JOYBUTTONDOWN:
|
||||
case SDL_JOYBUTTONUP:
|
||||
{
|
||||
@@ -326,6 +375,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_JoyDeviceEvent = { int type, int timestamp, int which }
|
||||
|
||||
Event occurs whenever a user connects or disconnects a joystick. Type SDL_JOYDEVICEADDED or SDL_JOYDEVICEREMOVED
|
||||
*/
|
||||
case SDL_JOYDEVICEADDED:
|
||||
case SDL_JOYDEVICEREMOVED:
|
||||
{
|
||||
@@ -339,6 +393,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_ControllerAxisEvent = { int type, int timestamp, int which, int axis, int value }
|
||||
|
||||
Event occurs whenever a user moves an axis on the controller. Type SDL_CONTROLLERAXISMOTION
|
||||
*/
|
||||
case SDL_CONTROLLERAXISMOTION:
|
||||
{
|
||||
lua_createtable( L, 5, 0 );
|
||||
@@ -355,6 +414,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_ControllerButtonEvent = { int type, int timestamp, int which, int button, int state }
|
||||
|
||||
Event occurs whenever a user presses or releases a button on a controller. Type SDL_CONTROLLERBUTTONDOWN or SDL_CONTROLLERBUTTONUP
|
||||
*/
|
||||
case SDL_CONTROLLERBUTTONDOWN:
|
||||
case SDL_CONTROLLERBUTTONUP:
|
||||
{
|
||||
@@ -372,6 +436,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_ControllerDeviceEvent = { int type, int timestamp, int which }
|
||||
|
||||
Event occurs whenever a user connects, disconnects or remaps a controller. Type SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED or SDL_CONTROLLERDEVICEREMAPPED
|
||||
*/
|
||||
case SDL_CONTROLLERDEVICEADDED:
|
||||
case SDL_CONTROLLERDEVICEREMOVED:
|
||||
case SDL_CONTROLLERDEVICEREMAPPED:
|
||||
@@ -386,6 +455,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_TouchFingerEvent = { int type, int timestamp, int touchId, int fingerId, float x, float y, float dx, float dy, float pressure }
|
||||
|
||||
Event occurs when an event of type SDL_FINGERMOTION, SDL_FINGERDOWN, or SDL_FINGERUP is reported. Type SDL_FINGERMOTION, SDL_FINGERDOWN or SDL_FINGERUP
|
||||
*/
|
||||
case SDL_FINGERMOTION:
|
||||
case SDL_FINGERDOWN:
|
||||
case SDL_FINGERUP:
|
||||
@@ -412,6 +486,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_MultiGestureEvent = { int type, int timestamp, int touchId, float dTheta, float dDist, float x, float y, int numFingers }
|
||||
|
||||
Event occurs when type SDL_MULTIGESTURE is reported. Type SDL_MULTIGESTURE
|
||||
*/
|
||||
case SDL_MULTIGESTURE:
|
||||
{
|
||||
lua_createtable( L, 8, 0 );
|
||||
@@ -434,6 +513,11 @@ static void platformSendEvents() {
|
||||
call = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
> SDL_DollarGestureEvent = { int type, int timestamp, int touchId, int gestureId, int numFingers, float error, float x, float y }
|
||||
|
||||
Event occurs an event of type SDL_DOLLARGESTURE or SDL_DOLLARRECORD is reported. Type SDL_DOLLARGESTURE or SDL_DOLLARRECORD
|
||||
*/
|
||||
case SDL_DOLLARGESTURE:
|
||||
case SDL_DOLLARRECORD:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user