#include <sdleventconverter.h>
Public Member Functions | |
SDLEventConverter (SDLInputService &service) | |
virtual | ~SDLEventConverter ()=default |
SDLEventConverter (SDLEventConverter &)=delete | |
SDLEventConverter & | operator= (const SDLEventConverter &)=delete |
SDLEventConverter (SDLEventConverter &&)=delete | |
SDLEventConverter & | operator= (SDLEventConverter &&)=delete |
bool | isInputEvent (SDL_Event &sdlEvent) const |
nap::InputEventPtr | translateInputEvent (SDL_Event &sdlEvent) |
bool | isKeyEvent (SDL_Event &sdlEvent) const |
nap::InputEventPtr | translateKeyEvent (SDL_Event &sdlEvent) |
bool | isMouseEvent (SDL_Event &sdlEvent) const |
nap::InputEventPtr | translateMouseEvent (SDL_Event &sdlEvent) |
bool | isTouchEvent (SDL_Event &sdlEvent) const |
nap::InputEventPtr | translateTouchEvent (SDL_Event &sdlEvent) |
bool | isControllerEvent (SDL_Event &sdlEvent) const |
nap::InputEventPtr | translateControllerEvent (SDL_Event &sdlEvent) |
bool | isWindowEvent (SDL_Event &sdlEvent) const |
nap::WindowEventPtr | translateWindowEvent (SDL_Event &sdlEvent) |
Converts SDL events into NAP Input Events
SDLEventConverter | ( | SDLInputService & | service | ) |
Constructor requires service to map device information
|
virtualdefault |
Default destructor
|
delete |
Copy is not allowed
|
delete |
Move is not allowed
bool isControllerEvent | ( | SDL_Event & | sdlEvent | ) | const |
Utility functions that checks if this is a controller input event (gamepad or joystick).
sdlEvent | the sdlEvent to verify, both joystick and controller events are considered valid. |
bool isInputEvent | ( | SDL_Event & | sdlEvent | ) | const |
Utility function that checks if this is an input event (key, mouse, touch or controller)
sdlEvent | the sdlEvent to verify |
bool isKeyEvent | ( | SDL_Event & | sdlEvent | ) | const |
Utility function that checks if this is a key input event (key press down/up or text input)
sdlEvent | the sdl event to check |
bool isMouseEvent | ( | SDL_Event & | sdlEvent | ) | const |
Utility function that checks if the sdl event is a mouse input event
sdlEvent | the SDL event to verify |
bool isTouchEvent | ( | SDL_Event & | sdlEvent | ) | const |
Utility functions that checks if this is a touch input event.
sdlEvent | the sdlEvent to verify, touch finger events are considered valid. |
bool isWindowEvent | ( | SDL_Event & | sdlEvent | ) | const |
Utility function to check if the sdl event is a nap window event.
sdlEvent | the sdl event to verify |
|
delete |
|
delete |
nap::InputEventPtr translateControllerEvent | ( | SDL_Event & | sdlEvent | ) |
Utility function to convert an SDL event into a nap controller event. This call assumes that the given SDL event can be translated into a NAP controller event! SDL Joystick and SDL Controller events are considered to be valid. Use isControllerEvent() to verify if the events are compatible.
sdlEvent | the SDL event to translate, can be from a joystick or controller |
nap::InputEventPtr translateInputEvent | ( | SDL_Event & | sdlEvent | ) |
Utility function to translate a SDL event to a generic nap InputEvent
sdlEvent | The event to translate |
nap::InputEventPtr translateKeyEvent | ( | SDL_Event & | sdlEvent | ) |
Utility function to translate an SDL event into a NAP key event This call assumes that the given SDL event can be translated into a NAP key event! Use isKeyEvent() to verify if the events are compatible
sdlEvent | the sdl event to translate |
nap::InputEventPtr translateMouseEvent | ( | SDL_Event & | sdlEvent | ) |
Utility function to translate an SDL event into a NAP mouse event. This call assumes that the given SDL event can be translated into a NAP pointer (mouse) event! Use isMouseEvent() to verify if the events are compatible.
sdlEvent | the sdl mouse event to translate |
nap::InputEventPtr translateTouchEvent | ( | SDL_Event & | sdlEvent | ) |
Utility function to translate an SDL event into a NAP touch event. This call assumes that the given SDL event can be translated into a NAP touch event! Use isTouchEvent() to verify if the events are compatible.
sdlEvent | the sdl mouse event to translate |
nap::WindowEventPtr translateWindowEvent | ( | SDL_Event & | sdlEvent | ) |
Utility function to convert a generic SDL event into a generic nap window event
sdlEvent | The event to convert to a nap window event. |