29#ifndef NOMLIB_SYSTEM_EVENT_HPP
30#define NOMLIB_SYSTEM_EVENT_HPP
34#include "nomlib/config.hpp"
35#include "nomlib/system/Joystick.hpp"
39const uint8 MAX_TEXT_INPUT_LENGTH = 32;
40const uint8 MAX_TEXT_EDITING_LENGTH = 32;
50enum MouseButton: uint8
52 LEFT_MOUSE_BUTTON = 1,
60typedef int64 FingerID;
64const uint32 TOUCH_MOUSE_ID = nom::NOM_UINT32_MAX;
94 KEYBOARD_FOCUS_GAINED,
415 char text[MAX_TEXT_INPUT_LENGTH];
427 char text[MAX_TEXT_EDITING_LENGTH];
468 MOUSE_BUTTON_RELEASE,
470 JOYSTICK_AXIS_MOTION,
471 JOYSTICK_BALL_MOTION,
473 JOYSTICK_BUTTON_PRESS,
474 JOYSTICK_BUTTON_RELEASE,
482 GAME_CONTROLLER_AXIS_MOTION,
484 GAME_CONTROLLER_BUTTON_PRESS,
485 GAME_CONTROLLER_BUTTON_RELEASE,
502 MULTI_FINGER_GESTURE,
506 RENDER_TARGETS_RESET,
547typedef std::function<void(
const Event&)> event_callback;
548typedef std::function<void(
const Event&,
void* data)> event_filter;
A structure containing information on a Drag 'N' Drop event.
const char * file_path
The path of the file dropped onto the nom::Window.
uint32 type
The event type.
uint32 timestamp
The recorded time at the moment of the event.
@ JOYSTICK_REMOVED
The instance ID of the joystick removal event.
@ JOYSTICK_ADDED
The device index of the joystick connection event.
@ GAME_CONTROLLER_REMOVED
The instance ID of the game controller removal event.
@ GAME_CONTROLLER_REMAPPED
The instance ID of the game controller remapping event.
@ GAME_CONTROLLER_ADDED
The device index of the game controller connection event.
A structure containing information on a finger (touch) event.
FingerID id
The finger index identifier.
float pressure
The quantity of the pressure applied; normalized 0..1.
float y
The Y coordinate of the event; normalized 0..1.
float x
The X coordinate of the event; normalized 0..1.
A structure containing information on a finger touch event.
FingerEvent finger
The finger index identifier.
float dy
The distance moved in the Y axis; normalized 0..1.
float pressure
The quantity of the pressure applied; normalized 0..1.
TouchID id
The touch device index identifier.
float x
The X coordinate of the event; normalized 0..1.
float y
The Y coordinate of the event; normalized 0..1.
float dx
The distance moved in the X axis; normalized 0..1.
A structure containing information on a game controller axis motion event.
int16 value
The axis value.
JoystickID id
The joystick instance identifier.
int8 axis
Index of the axis on the device.
Internal representation of a game controller device connection event.
JoystickID id
The joystick instance identifier.
A structure containing information on a multi-finger gesture (touch) event.
float y
The Y coordinate of the event.
float x
The X coordinate of the event.
uint16 num_fingers
The number of fingers used in the gesture event.
TouchID id
The touch device index identifier.
A structure containing information on a joystick axis motion event.
uint8 axis
Index of the axis on the device.
JoystickID id
The joystick instance identifier.
int16 value
The current position of the axis.
Internal representation of a joystick device connection event.
JoystickID id
The joystick instance identifier.
Internal representation of a joystick hat position.
uint8 value
The hat position value.
uint8 hat
The index of the joystick hat.
JoystickID id
The joystick instance identifier.
A structure containing information on a keyboard event.
uint16 mod
An enumeration of key modifier masks; see also: the SDL2 wiki documentation page for SDL_Keymod.
int32 sym
The virtual key code.
uint8 repeat
Non-zero if this is a repeating key press event.
uint8 state
The state of the key press event.
uint16 scan_code
The physical key code.
uint32 window_id
The identifier of the window at the moment of the event.
A structure containing information on a mouse event.
uint8 state
The state of the button.
uint32 window_id
The identifier of the window at the moment of the event.
int32 x
The X coordinate, relative to the nom::Window instance.
int32 x_rel
The relative motion in the X coordinate direction.
int32 y_rel
The relative motion in the Y coordinate direction.
uint32 id
The mouse instance identifier, or SDL_TOUCH_MOUSEID.
int32 y
The Y coordinate, relative to the nom::Window instance.
A structure containing information on a mouse wheel event.
int32 x
X axis value; relative to the direction of the wheel.
int32 y
Y axis value, relative to the direction of the wheel.
uint32 id
The mouse instance identifier, or SDL_TOUCH_MOUSEID.
uint32 window_id
The identifier of the window at the moment of event.
Representation of a program termination request.
void * data1
User-defined data.
void * data2
User-defined data.
A structure containing information on a text editing event.
int32 length
The number of characters to edit from the start point.
int32 start
The location to begin editing from.
uint32 window_id
The identifier of the window at the moment of the event.
char text[MAX_TEXT_EDITING_LENGTH]
The text being edited.
A structure containing information on a text input event.
uint32 window_id
The identifier of the window at the moment of the event.
char text[MAX_TEXT_INPUT_LENGTH]
The text input.
A structure containing information on an user event.
uint32 window_id
The identifier of the window at the moment of the event.
void * data2
User defined data pointer.
int32 code
User defined event code.
void * data1
User defined data pointer.
A structure containing information on a window event.
uint8 event
The window's event type.
EventType
Window event types.
uint32 window_id
The identifier of the window at the moment of the event.
int32 data2
Event dependent data; typically the Y coordinate position or height data of an event.
int32 data1
Event dependent data; typically the X coordinate position or width data of an event.