21 #include "../../SDL_internal.h" 23 #if SDL_VIDEO_DRIVER_NACL 26 #include "../../events/SDL_sysevents.h" 27 #include "../../events/SDL_events_c.h" 30 #include "ppapi_simple/ps_event.h" 295 case PP_INPUTEVENT_MOUSEBUTTON_LEFT:
297 case PP_INPUTEVENT_MOUSEBUTTON_MIDDLE:
299 case PP_INPUTEVENT_MOUSEBUTTON_RIGHT:
302 case PP_INPUTEVENT_MOUSEBUTTON_NONE:
309 SDL_NACL_translate_keycode(
int keycode)
314 scancode = NACL_Keycodes[keycode];
317 SDL_Log(
"The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list <https://discourse.libsdl.org/> NACL KeyCode %d", keycode);
325 PP_InputEvent_Type
type;
328 struct PP_FloatPoint fp;
338 while ((ps_event = PSEventTryAcquire()) !=
NULL) {
339 event = ps_event->as_resource;
340 switch(ps_event->type) {
342 case PSE_INSTANCE_DIDCHANGEVIEW:
349 case PSE_INSTANCE_HANDLEINPUT:
353 case PP_INPUTEVENT_TYPE_MOUSEDOWN:
356 case PP_INPUTEVENT_TYPE_MOUSEUP:
359 case PP_INPUTEVENT_TYPE_WHEEL:
365 case PP_INPUTEVENT_TYPE_MOUSEENTER:
366 case PP_INPUTEVENT_TYPE_MOUSELEAVE:
371 case PP_INPUTEVENT_TYPE_MOUSEMOVE:
376 case PP_INPUTEVENT_TYPE_TOUCHSTART:
377 case PP_INPUTEVENT_TYPE_TOUCHMOVE:
378 case PP_INPUTEVENT_TYPE_TOUCHEND:
379 case PP_INPUTEVENT_TYPE_TOUCHCANCEL:
383 case PP_INPUTEVENT_TYPE_KEYDOWN:
387 case PP_INPUTEVENT_TYPE_KEYUP:
391 case PP_INPUTEVENT_TYPE_CHAR:
393 str = driverdata->
ppb_var->VarToUtf8(var, &str_len);
399 text[str_len] =
'\0';
412 case PSE_INSTANCE_HANDLEMESSAGE:
416 case PSE_INSTANCE_DIDCHANGEFOCUS:
420 case PSE_GRAPHICS3D_GRAPHICS3DCONTEXTLOST:
424 case PSE_MOUSELOCK_MOUSELOCKLOST:
431 PSEventRelease(ps_event);
SDL_Mouse * SDL_GetMouse(void)
const PPB_MouseInputEvent * ppb_mouse_input_event
const PPB_WheelInputEvent * ppb_wheel_input_event
const PPB_InputEvent * ppb_input_event
const PPB_View * ppb_view
int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
static SDL_VideoDevice * _this
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
int SDL_SendKeyboardText(const char *text)
void NACL_SetScreenResolution(int width, int height, Uint32 format)
#define SDL_BUTTON_MIDDLE
void NACL_PumpEvents(_THIS)
const PPB_KeyboardInputEvent * ppb_keyboard_input_event
int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction)
static char text[MAX_TEXT_LENGTH]
GLuint GLuint GLsizei GLenum type
#define SDL_arraysize(array)
#define SDL_TEXTINPUTEVENT_TEXT_SIZE
EGLint EGLint EGLuint64KHR * modifiers
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
SDL_Scancode
The SDL keyboard scancode representation.