Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Public Attributes | List of all members
Event Struct Reference

Event sent by system, interface or game. More...

#include <event.h>

Public Member Functions

 Event (EventType _type=EVENT_NULL)
 

Public Attributes

EventType type
 Type of event.
 
float rTime
 
Math::Vector motionInput
 
unsigned int kmodState
 
Math::Point mousePos
 
unsigned int mouseButtonsState
 
long customParam
 
union {
   KeyEventData   key
 Additional data for EVENT_KEY_DOWN and EVENT_KEY_UP.
 
   MouseButtonEventData   mouseButton
 Additional data for EVENT_MOUSE_BUTTON_DOWN and EVENT_MOUSE_BUTTON_UP.
 
   MouseWheelEventData   mouseWheel
 Additional data for EVENT_MOUSE_WHEEL.
 
   JoyAxisEventData   joyAxis
 Additional data for EVENT_JOY.
 
   JoyButtonEventData   joyButton
 Additional data for EVENT_JOY_AXIS.
 
   ActiveEventData   active
 Additional data for EVENT_ACTIVE.
 
}; 
 Union with additional data, applicable only to some events.
 

Detailed Description

Event sent by system, interface or game.

Event is described by its type (EventType) and anonymous union that contains additional data about the event. Different members of the union are filled with different event types. With some events, nothing is filled (it's zeroed out). The union contains roughly the same information as SDL_Event struct but packaged to independent structs and fields.

Member Data Documentation

long Event::customParam

Custom parameter that may be set for some events Scope: some interface events

unsigned int Event::kmodState

Current state of keyboard modifier keys: bitmask made of KEY_MOD(...) macro values (from common/key.h) Scope: all system events

Math::Vector Event::motionInput

Motion vector set by keyboard or joystick (managed by CInput) Scope: all system events

unsigned int Event::mouseButtonsState

Current state of mouse buttons: bitmask of MouseButton enum values Scope: all system events

Math::Point Event::mousePos

Current position of mouse cursor in interface coords Scope: all system events

float Event::rTime

Relative time since last EVENT_FRAME Scope: only EVENT_FRAME events


The documentation for this struct was generated from the following file: