WindowEvent

Event structure on Window Events.

Members

Enums

Type
enum Type

Types that can occur when WindowEvents are fired.

Functions

fromSDL
void fromSDL(SDL_Event event)

Function for converting a SDL event to a WindowEvent

Variables

axis
int axis;

Axis id in ControllerAxis event.

axisValue
short axisValue;

Axis value in ControllerAxis event.

controllerID
int controllerID;

Controller id in Controller* event.

key
int key;

Key in Controller and Keyboard events.

mousebutton
int mousebutton;

Mouse button in Mouse events.

text
string text;

Text contained in TextEntered event.

type
Type type;
Undocumented in source.
x
int x;

x/width in events.

xrel
int xrel;

Relative mouse coordinates in Mouse events.

y
int y;

y/height in events.

yrel
int yrel;

Relative mouse coordinates in Mouse events.

Examples

SDL_Event	source;
WindowEvent event;
source.type			  = SDL_KEYDOWN;
source.key.keysym.sym = 42;
event.fromSDL(source);

assert(event.type == WindowEvent.Type.KeyPressed);
assert(event.key == 42);

Meta