Event structure on Window 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);
- enum Type: int;
- Types that can occur when WindowEvents are fired.
- Close
- Occurs when X button is clicked.
- Resized
- Occurs when window got resized.
- Moved
- Occurs when window got moved.
- LostFocus
- Occurs when window lost focus.
- GainedFocus
- Occurs when window gained focus again.
- Shown
- Occurs when
window.show
got called.
- Hidden
- Occurs when
window.hide
got called.
- Minimized
- Occurs when the window minimizes.
- Maximized
- Occurs when the window maximizes.
- Restored
- Occurs when the window restores from minimized/maximized state.
- TextEntered
- Occurs when the user typed some text on the keyboard for text fields.
- KeyPressed
- Occurs when the user presses a key on the keyboard. Will fire repeatedly when held down.
- KeyReleased
- Occurs when the user releases a key on the keyboard.
- MouseWheelMoved
- Occurs when the user scrolled.
- MouseButtonPressed
- Occurs when the user pressed a mouse button.
- MouseButtonReleased
- Occurs when the user released a mouse button.
- MouseMoved
- Occurs when the user moved the mouse.
- MouseEntered
- Occurs when the mouse hovers over the window.
- MouseLeft
- Occurs when the mouse no longer hovers over the window
- ControllerButtonPressed
- Occurs when a button on a controller got pressed.
- ControllerButtonReleased
- Occurs when a button on a controller got released.
- ControllerAxis
- Occurs when an axis on a controller got moved.
- ControllerConnected
- Occurs when a controller connected.
- ControllerDisconnected
- Occurs when a controller disconnected.
- Quit
- Occurs when window is closing.
- Type type;
- Type of this event.
- int x;
- x position in events.
- int width;
- width in events.
- int y;
- y position in events.
- int height;
- height in events.
- int xrel;
- Relative mouse coordinates in Mouse events.
- int yrel;
- Relative mouse coordinates in Mouse events.
- int mousebutton;
- Mouse button in Mouse events.
- int key;
- Key in Controller and Keyboard events.
- int axis;
- Axis id in ControllerAxis event.
- int controllerID;
- Controller id in any Controller event.
- short axisValue;
- Axis value in ControllerAxis event.
- ubyte repeat;
- Non-zero if this is a key repeat.
- string text;
- Text contained in TextEntered event.
- void fromSDL(ref const SDL_Event event);
- Function for converting a SDL event to a WindowEvent