CrystalSpace

Public API Reference

Event handling

Classes

class  csBaseEventHandler
 Base implementation of a generic event handler. More...
struct  csCommandEventData
 Structure that collects the data a command event carries. More...
class  csCommandEventHelper
 Helper class to conveniently deal with command events. More...
class  csEventHandlerRegistry
 The csEventHandlerRegistry maintains a global one-to-one mapping from strings to csHandlerIDs, and a one-to-(zero or one) mapping from csHandlerIDs to iEventHandler pointers. More...
class  csEventNameRegistry
 The csEventNameRegistry transforms textual event names (e.g., "crystalspace.input.joystick.3.button") into easier-to-manage csEventID's (which, in non-debug builds, are really just csStringID's). More...
class  csInputEventHelper
 Helper class to conveniently pull generic data out of input events. More...
struct  csJoystickEventData
 Structure that collects the data a joystick event carries. More...
class  csJoystickEventHelper
 Helper class to conveniently deal with joystick events. More...
struct  csKeyEventData
 Structure that collects the data a keyboard event carries. More...
class  csKeyEventHelper
 Helper class to conveniently deal with keyboard events. More...
struct  csMouseEventData
 Structure that collects the data a mouse event carries. More...
class  csMouseEventHelper
 Helper class to conveniently deal with mouse events. More...
class  FrameBegin3DDraw
 FrameBegin3DDraw handles every csevFrame event in the 3D phase. More...
class  FramePrinter
 FramePrinter handles every csevFrame event in the FRAME (final) phase. More...
struct  iEvent
 This interface describes any system event. More...
struct  iEventAttributeIterator
 Event attribute iterator. More...
struct  iEventCord
 The iEventCord is an interface provided by an event queue to any event handlers wanting to receive some subclasses of events ASAP in a specified priority, bypassing the queue itself. More...
struct  iEventHandler
 This interface describes an entity that can receive events. More...
struct  iEventHandlerRegistry
 This interface represents a general event handler registry/resolver. More...
struct  iEventNameRegistry
 This interface represents a general event name resolver. More...
struct  iEventOutlet
 The iEventOutlet is the interface to an object that is provided by an event queue to every event plug when it registers itself. More...
struct  iEventPlug
 Event plug interface, also referred as "event source". More...
struct  iEventQueue
 This interface represents a general event queue. More...
struct  iJoystickDriver
 Generic Joystick driver. More...
struct  iKeyboardDriver
 Generic Keyboard Driver. More...
struct  iKeyComposer
 Keyboard input handler. More...
struct  iMouseDriver
 Generic Mouse Driver. More...

Namespaces

namespace  CS
 

Main namespace for CrystalSpace.


Defines

#define CS_DECLARE_EVENT_SHORTCUTS
 Shortcut to declare class properties SystemOpen, SystemClose, Frame.
#define CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS
 Macro to declare instance constraints which are the same as the generics.
#define CS_EVENTHANDLER_NAMES(x)
 Macro to create default GenericName and GenericName methods.
#define CS_EVENTHANDLER_NIL_CONSTRAINTS
 Macro to create "nil" generic and instance constraints.
#define CS_EVENTHANDLER_NIL_GENERIC_CONSTRAINTS
 Macro to create nil generic constraints.
#define CS_INITIALIZE_EVENT_SHORTCUTS(object_reg)
 Shortcut to initialize the properties declared by CS_DECLARE_EVENT_SHORTCUTS.
#define CS_MAX_JOYSTICK_AXES   8
 Maximal number of joystick axes supported.
#define CS_MAX_JOYSTICK_BUTTONS   32
 Maximal number of joystick buttons supported.
#define CS_MAX_JOYSTICK_COUNT   16
 Maximal number of joysticks supported.
#define CS_MAX_MOUSE_AXES   8
 Maximal number of mouse axes supported.
#define CS_MAX_MOUSE_BUTTONS   10
 Maximal number of mouse buttons supported.
#define CS_MAX_MOUSE_COUNT   4
 Maximal number of mice supported.

Typedefs

typedef csStringID csEventID
 A csEventID is a handle for a string representing an event's hierarchical name (e.g., "crystalspace.input.keyboard.down").
typedef enum _csKeyEventType csKeyEventType
 Keyboard event type - stored as keyEventType attribute in keyboard events.
typedef enum _csMouseEventType csMouseEventType
 Mouse event type - stored as mEventType attribute in mouse events.

Enumerations

enum  _csKeyEventType { csKeyEventTypeUp = 0, csKeyEventTypeDown }
 

Keyboard event type - stored as keyEventType attribute in keyboard events.

More...
enum  _csMouseEventType {
  csMouseEventTypeMove = 0, csMouseEventTypeUp, csMouseEventTypeDown, csMouseEventTypeClick,
  csMouseEventTypeDoubleClick
}
 

Mouse event type - stored as mEventType attribute in mouse events.

More...
enum  csEventAttributeType {
  csEventAttrUnknown, csEventAttrInt, csEventAttrUInt, csEventAttrFloat,
  csEventAttrDatabuffer, csEventAttrEvent, csEventAttriBase, csEventAttrRawPtr
}
 

Various attribute data types supported by the event system (iEvent).

More...
enum  csEventError {
  csEventErrNone, csEventErrLossy, csEventErrNotFound, csEventErrMismatchInt,
  csEventErrMismatchUInt, csEventErrMismatchFloat, csEventErrMismatchBuffer, csEventErrMismatchEvent,
  csEventErrMismatchIBase, csEventErrUhOhUnknown
}
 

Error codes for event attribute retrieval.

More...
enum  csKeyComposeResult { csComposeNoChar = -1, csComposeNormalChar, csComposeComposedChar, csComposeUncomposeable }
 

Results for attempts to process a character key.

More...
enum  csMouseButton {
  csmbNone = -1, csmbLeft = 0, csmbRight = 1, csmbMiddle = 2,
  csmbWheelUp = 3, csmbWheelDown = 4, csmbExtra1 = 5, csmbExtra2 = 6,
  csmbHWheelLeft = 7, csmbHWheelRight = 8
}
 

Constants for mouse buttons.

More...

Common system events

These are the names of some of the most commonly-used system-generated events.

Some events are "umbrella events", that is, subscribing to them means that all events of a certain kind are received (e.g. csevMouse for mouse events), but the "umbrella events" themselves are not sent to event handlers! In the mouse events examples, you would have to check for the names of "leaf events" in the event handler, such as csevMouseDown, csevMouseMove etc. For information on event names see the user manual, section "Event Names".

Third-party applications can define their own event names. You should avoid using the "crystalspace." prefix (which is reserved for internally-generated events).



static csEventID csevCanvasOp (iObjectRegistry *object_reg, const iGraphics2D *g2d, const csString &y)
 Check if an event is any input event.
csEventID csevCanvasOp (csRef< iEventNameRegistry > &reg, const iGraphics2D *g2d, const csString &y)
 Check if an event is any input event.
static csEventID csevJoystick (iObjectRegistry *object_reg, uint x)
 Check if an event is any input event.
static csEventID csevJoystick (iEventNameRegistry *name_reg, uint x)
 Check if an event is any input event.
static csEventID csevJoystickOp (iObjectRegistry *object_reg, uint x, const csString &y)
 Check if an event is any input event.
static csEventID csevJoystickOp (iEventNameRegistry *name_reg, uint x, const csString &y)
 Check if an event is any input event.
static csEventID csevMouse (iObjectRegistry *object_reg, uint x)
 Check if an event is any input event.
static csEventID csevMouse (iEventNameRegistry *name_reg, uint x)
 Check if an event is any input event.
static csEventID csevMouseOp (iObjectRegistry *object_reg, uint x, const csString &y)
 Check if an event is any input event.
static csEventID csevMouseOp (iEventNameRegistry *name_reg, uint x, const csString &y)
 Check if an event is any input event.
#define CS_IS_INPUT_EVENT(reg, e)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevInput(reg))
 Check if an event is any input event.
#define CS_IS_JOYSTICK_BUTTON_EVENT(reg, e, n)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevJoystickButton((reg),n))
 Check if an event is a button event from mouse n (basis 0).
#define CS_IS_JOYSTICK_EVENT(reg, e)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevJoystickEvent(reg))
 Check if an event is a joystick event.
#define CS_IS_JOYSTICK_MOVE_EVENT(reg, e, n)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevJoystickMove((reg),n))
 Check if an event is a move event from mouse n (basis 0).
#define CS_IS_KEYBOARD_EVENT(reg, e)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevKeyboardEvent(reg))
 Check if an event is a keyboard event.
#define CS_IS_MOUSE_BUTTON_EVENT(reg, e, n)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevMouseButton((reg),n))
 Check if an event is a button event from mouse n (basis 0).
#define CS_IS_MOUSE_EVENT(reg, e)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevMouseEvent(reg))
 Check if an event is a mouse event.
#define CS_IS_MOUSE_MOVE_EVENT(reg, e, n)   csEventNameRegistry::IsKindOf((reg), ((e).Name), csevMouseMove((reg),n))
 Check if an event is a move event from mouse n (basis 0).
#define csevAllEvents(reg)   (csEventNameRegistry::GetID((reg), ""))
 Root event.
#define csevCanvasClose(reg, g2d)   csevCanvasOp((reg), (g2d), "close")
 This event is sent when a graphics context x is being destroyed (where x is an iGraphics2D pointer).
#define csevCanvasExposed(reg, g2d)   csevCanvasOp((reg), (g2d), "exposed")
 Broadcast indicating that the display canvas has just become visible, such as being uniconified (where x is an iGraphics2D pointer).
#define csevCanvasHidden(reg, g2d)   csevCanvasOp((reg), (g2d), "hidden")
 Broadcast indicating that the canvas x is not currently visible to the user, such as being iconified (where x is an iGraphics2D pointer).
#define csevCanvasResize(reg, g2d)   csevCanvasOp((reg), (g2d), "resize")
 This event is generated when user resizes the application window corresponding with context x (where x is an iGraphics2D pointer).
#define csevCommandLineHelp(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.application.commandlinehelp"))
 This event is broadcasted when system driver displays the help text for all supported command-line switches.
#define csevFocusChanged(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.application.focus"))
 Children of this event are generated whenever application (as a whole) receives or loses focus.
#define csevFocusGained(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.application.focus.gained"))
 This event is generated whenever user application (as a whole) receives system focus.
#define csevFocusLost(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.application.focus.lost"))
 This event is generated whenever user application (as a whole) loses system focus.
#define csevFrame(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.frame"))
 Frame event.
#define csevInput(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.input"))
 Generic input event.
#define csevJoystickButton(reg, x)   csevJoystickOp((reg),(x),"button")
 Generic joystick button event from joystick x.
#define csevJoystickDown(reg, x)   csevJoystickOp((reg),(x),"button.down")
 Button down event from joystick x. The first system joystick is 0.
#define csevJoystickEvent(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.input.joystick"))
 Generic joystick event.
#define csevJoystickMove(reg, x)   csevJoystickOp((reg),(x),"move")
 Move event from joystick x. The first system joystick is 0.
#define csevJoystickUp(reg, x)   csevJoystickOp((reg),(x),"button.up")
 Button up event from joystick x. The first system joystick is 0.
#define csevKeyboardDown(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.input.keyboard.down"))
 Keyboard key down event.
#define csevKeyboardEvent(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.input.keyboard"))
 Generic keyboard event.
#define csevKeyboardUp(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.input.keyboard.up"))
 Keyboard key up event.
#define csevMouseButton(reg, x)   csevMouseOp ((reg), (x), "button")
 Generic button event from mouse x.
#define csevMouseClick(reg, x)   csevMouseOp ((reg), (x), "button.click")
 Click event from mouse x.
#define csevMouseDoubleClick(reg, x)   csevMouseOp((reg), (x), "button.doubleclick")
 Double-click event from mouse x.
#define csevMouseDown(reg, x)   csevMouseOp ((reg), (x), "button.down")
 Button down event from mouse x.
#define csevMouseEvent(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.input.mouse"))
 Generic mouse event.
#define csevMouseMove(reg, x)   csevMouseOp((reg), (x), "move")
 Move event from mouse x.
#define csevMouseUp(reg, x)   csevMouseOp ((reg), (x), "button.up")
 Button up event from mouse x.
#define csevQuit(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.application.quit"))
 This event causes system driver to quit the event loop, even if the event loop has been entered multiple times.
#define csevSystemClose(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.application.close"))
 This event is broadcasted to all event listeners just before modules are about to be shutdown and unloaded (that is, the system is shutting down).
#define csevSystemOpen(reg)   (csEventNameRegistry::GetID((reg), "crystalspace.application.open"))
 This event is broadcasted to all event listeners just after all modules have been initialized.

Keyboard events

Keyboard events are emitted when the user does something with the keyboard - presses down a key ("key down" events), holds it down (more "key down" events in a specific interval - "auto-repeat") and releases it ("key up").

Every keyboard event has a bunch of data associated with it. First, there is a code to identify the key: the 'raw' code. It uniquely identifies the key, and every key has a distinct code, independent from any pressed modifiers: For example, pressing the "A" key will always result in the raw code 'a', holding shift or any other modifier down won't change it. However, the 'cooked' code contains such additional information: If Shift+A is pressed, the cooked code will be 'A', while the raw code is still 'a'. Other keys are also normalized; for example keypad keys: pressing "9" will result in either CSKEY_PGUP or '9', depending on the NumLock state. So, the same key can result in different 'cooked' codes, and the same 'cooked' code can be caused by different keys.

Other data contained in a keyboard event is:

Keyboard event data is stored as properties of iEvent, accessible thorugh iEvent->Find() and iEvent->Add().

Property Name

Type

Description

keyEventType

csKeyEventType (stored as uint8)

Event type (up vs down)

keyCodeRaw

uint32

Raw key code

keyCodeCooked

uint32

Cooked key code

keyModifiers

csKeyModifiers

Modifiers at time of the key press

keyAutoRepeat

bool

Autorepeat flag

keyCharType

csKeyCharType (stored as uint8)

Character type

A way to retrieve an keyboard event's data without requiring a plethora of iEvent->Find() invocations provides the csKeyEventHelper class.

Also see iKeyComposer for informations about composing accented etc. characters from dead and normal keys.

Overall structure of the basic event flow in Crystal Space

   ......................
   .User application    .
   . +----------------+ .
 +-->+ Event consumer | .
 | . +----------------+ .
 | ......................
 |
 | .....................................
 | .System driver plugin               .
 | .                          +------+ .   +-----+
 | .                       +<-|event +-<<--+event|
 | .   +---------------+   |  |outlet| .   |plug |
 +-----+  event queue  +<--+  +------+ .   +-----+
 | .   +---------------+   |  +------+ .   +-----+
 | .                       +<-|event +-<<--+event|
 | .   +---------------+   |  |outlet| .   |plug |
 +-----+ event cord    +<--|  +------+ .   +-----+
   .   +---------------+   |  +------+ .   +-----+
   .                       +<-|event +-<<--+event|
   .                          |outlet| .   |plug |
   .                          +------+ .   +-----+
   .                            ....   .     ...
   .....................................
 

The events are generated by 'event plugs' which are plugged into 'event outlets'. The event outlets are reponsible for filtering the possibly duplicate messages that are coming from different event plugs (for example two different plugs may both intercept the keyboard and generate duplicate keydown events).

Events are put into the event queue, from where they are sent to applications and plugins. Event cords bypass the queue for specific command event categories and deliver events immediately in a prioritizied chain to specific plugins which request the categories.


Define Documentation

#define CS_DECLARE_EVENT_SHORTCUTS
Value:
CS_DECLARE_SYSTEM_EVENT_SHORTCUTS;                              \
  CS_DECLARE_FRAME_EVENT_SHORTCUTS;                             \
  CS_DECLARE_INPUT_EVENT_SHORTCUTS

Shortcut to declare class properties SystemOpen, SystemClose, Frame.

Pair with CS_INITIALIZE_EVENT_SHORTCUTS(registry).

Definition at line 501 of file eventnames.h.

#define CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS
Value:
virtual const csHandlerID * InstancePrec (              \
    csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,    \
    csEventID e) const { return GenericPrec(r1, r2, e); } \
  virtual const csHandlerID * InstanceSucc (            \
    csRef<iEventHandlerRegistry> &r1, csRef<iEventNameRegistry> &r2,    \
    csEventID e) const { return GenericSucc(r1, r2, e); }

Macro to declare instance constraints which are the same as the generics.

Definition at line 196 of file eventh.h.

#define CS_EVENTHANDLER_NAMES (  ) 
Value:
static const char * StaticHandlerName()         \
  { return (x); }                                                       \
  static const csHandlerID StaticID(csRef<iEventHandlerRegistry> &reg) \
  {return reg->GetGenericID(StaticHandlerName()); }                     \
  virtual const char * GenericName() const              \
  { return StaticHandlerName(); }                                       \
  virtual csHandlerID GenericID(csRef<iEventHandlerRegistry> &reg) const \
  { return StaticID(reg); }

Macro to create default GenericName and GenericName methods.

Also declares StaticHandlerName, which can be used to reference a class of event handlers abstractly without having any of them loaded.

Definition at line 165 of file eventh.h.

#define CS_EVENTHANDLER_NIL_CONSTRAINTS
Value:

Macro to create "nil" generic and instance constraints.

Definition at line 178 of file eventh.h.

#define CS_EVENTHANDLER_NIL_GENERIC_CONSTRAINTS
Value:
virtual const csHandlerID * GenericPrec (               \
    csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &,        \
    csEventID) const { return 0; }      \
  virtual const csHandlerID * GenericSucc (             \
    csRef<iEventHandlerRegistry> &, csRef<iEventNameRegistry> &,        \
    csEventID) const { return 0; }

Macro to create nil generic constraints.

Definition at line 185 of file eventh.h.

#define CS_INITIALIZE_EVENT_SHORTCUTS ( object_reg   ) 
Value:
do {    \
    CS_INITIALIZE_SYSTEM_EVENT_SHORTCUTS (object_reg);  \
    CS_INITIALIZE_FRAME_EVENT_SHORTCUTS (object_reg);   \
    CS_INITIALIZE_INPUT_EVENT_SHORTCUTS (object_reg);   \
  } while (0)

Shortcut to initialize the properties declared by CS_DECLARE_EVENT_SHORTCUTS.

Requires an iObjectRegistry or iEventNameRegistry.

Definition at line 526 of file eventnames.h.

#define CS_IS_INPUT_EVENT ( reg,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevInput(reg))

Check if an event is any input event.

Definition at line 360 of file eventnames.h.

#define CS_IS_JOYSTICK_BUTTON_EVENT ( reg,
e,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevJoystickButton((reg),n))

Check if an event is a button event from mouse n (basis 0).

Definition at line 352 of file eventnames.h.

#define CS_IS_JOYSTICK_EVENT ( reg,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevJoystickEvent(reg))

Check if an event is a joystick event.

Definition at line 348 of file eventnames.h.

#define CS_IS_JOYSTICK_MOVE_EVENT ( reg,
e,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevJoystickMove((reg),n))

Check if an event is a move event from mouse n (basis 0).

Definition at line 356 of file eventnames.h.

#define CS_IS_KEYBOARD_EVENT ( reg,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevKeyboardEvent(reg))

Check if an event is a keyboard event.

Definition at line 332 of file eventnames.h.

#define CS_IS_MOUSE_BUTTON_EVENT ( reg,
e,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevMouseButton((reg),n))

Check if an event is a button event from mouse n (basis 0).

Definition at line 340 of file eventnames.h.

#define CS_IS_MOUSE_EVENT ( reg,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevMouseEvent(reg))

Check if an event is a mouse event.

Definition at line 336 of file eventnames.h.

#define CS_IS_MOUSE_MOVE_EVENT ( reg,
e,
 )     csEventNameRegistry::IsKindOf((reg), ((e).Name), csevMouseMove((reg),n))

Check if an event is a move event from mouse n (basis 0).

Definition at line 344 of file eventnames.h.

#define CS_MAX_JOYSTICK_AXES   8

Maximal number of joystick axes supported.

Definition at line 50 of file event.h.

#define CS_MAX_JOYSTICK_BUTTONS   32

Maximal number of joystick buttons supported.

Definition at line 48 of file event.h.

#define CS_MAX_JOYSTICK_COUNT   16

Maximal number of joysticks supported.

Definition at line 46 of file event.h.

#define CS_MAX_MOUSE_AXES   8

Maximal number of mouse axes supported.

Definition at line 42 of file event.h.

#define CS_MAX_MOUSE_BUTTONS   10

Maximal number of mouse buttons supported.

Definition at line 44 of file event.h.

#define CS_MAX_MOUSE_COUNT   4

Maximal number of mice supported.

Definition at line 40 of file event.h.

#define csevAllEvents ( reg   )     (csEventNameRegistry::GetID((reg), ""))

Root event.

All event names are children of this one. WARNING: it's easy to just subscribe to this event, but this will make subscription computationally expensive and may cause lots of spurious events to be delivered to your handler. Only subscribe to this event if you know what you're doing!

Remarks:
"Umbrella" event.

Definition at line 162 of file eventnames.h.

#define csevCanvasClose ( reg,
g2d   )     csevCanvasOp((reg), (g2d), "close")

This event is sent when a graphics context x is being destroyed (where x is an iGraphics2D pointer).

Usually this event is accompanyed by a shutdown but there are exceptions, e.g., when a dynamic texture is closed (a dynamic texture is a graphics context as well).

 Info: (iGraphics2D *) The context that has been closed
 

Definition at line 452 of file eventnames.h.

#define csevCanvasExposed ( reg,
g2d   )     csevCanvasOp((reg), (g2d), "exposed")

Broadcast indicating that the display canvas has just become visible, such as being uniconified (where x is an iGraphics2D pointer).

Definition at line 467 of file eventnames.h.

#define csevCanvasHidden ( reg,
g2d   )     csevCanvasOp((reg), (g2d), "hidden")

Broadcast indicating that the canvas x is not currently visible to the user, such as being iconified (where x is an iGraphics2D pointer).

Definition at line 460 of file eventnames.h.

#define csevCanvasResize ( reg,
g2d   )     csevCanvasOp((reg), (g2d), "resize")

This event is generated when user resizes the application window corresponding with context x (where x is an iGraphics2D pointer).

 Info: (iGraphics2D *) The context that has been resized
 

Definition at line 439 of file eventnames.h.

#define csevCommandLineHelp ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.application.commandlinehelp"))

This event is broadcasted when system driver displays the help text for all supported command-line switches.

Upon reception of such event every plugin should display a short help for any of the command-line switches it supports. The general format is:

<2 spaces><switch - 18 positions><space>
<switch description>{default value}

The help should be displayed to standard output.

Definition at line 479 of file eventnames.h.

#define csevFocusChanged ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.application.focus"))

Children of this event are generated whenever application (as a whole) receives or loses focus.

Remarks:
"Umbrella" event.

Definition at line 379 of file eventnames.h.

#define csevFocusGained ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.application.focus.gained"))

This event is generated whenever user application (as a whole) receives system focus.

The application may react by staring music, showing software mouse cursor and so on.

Definition at line 387 of file eventnames.h.

#define csevFocusLost ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.application.focus.lost"))

This event is generated whenever user application (as a whole) loses system focus.

Upon this event the application may react by stopping music, hiding software mouse cursor and so on.

Definition at line 395 of file eventnames.h.

#define csevFrame ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.frame"))

Frame event.

This is sent once per frame. This should drive all rendering, periodic/clocked game state updates, input device polling, etc.

Definition at line 170 of file eventnames.h.

#define csevInput ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.input"))

Generic input event.

All actual input events are children of this one.

Remarks:
"Umbrella" event.

Definition at line 177 of file eventnames.h.

#define csevJoystickButton ( reg,
 )     csevJoystickOp((reg),(x),"button")

Generic joystick button event from joystick x.

All actual joystick button events are children of this one. The first system joystick is 0.

Remarks:
"Umbrella" event.

Definition at line 316 of file eventnames.h.

#define csevJoystickDown ( reg,
 )     csevJoystickOp((reg),(x),"button.down")

Button down event from joystick x. The first system joystick is 0.

Definition at line 320 of file eventnames.h.

#define csevJoystickEvent ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.input.joystick"))

Generic joystick event.

All actual joystick events are children of this one.

Remarks:
"Umbrella" event.

Definition at line 276 of file eventnames.h.

#define csevJoystickMove ( reg,
 )     csevJoystickOp((reg),(x),"move")

Move event from joystick x. The first system joystick is 0.

Definition at line 328 of file eventnames.h.

#define csevJoystickUp ( reg,
 )     csevJoystickOp((reg),(x),"button.up")

Button up event from joystick x. The first system joystick is 0.

Definition at line 324 of file eventnames.h.

#define csevKeyboardDown ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.input.keyboard.down"))

Keyboard key down event.

Definition at line 189 of file eventnames.h.

#define csevKeyboardEvent ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.input.keyboard"))

Generic keyboard event.

All actual keyboard events are children of this one.

Remarks:
"Umbrella" event.

Definition at line 185 of file eventnames.h.

#define csevKeyboardUp ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.input.keyboard.up"))

Keyboard key up event.

Definition at line 193 of file eventnames.h.

#define csevMouseButton ( reg,
 )     csevMouseOp ((reg), (x), "button")

Generic button event from mouse x.

All button events from mouse x are children of this one. The default system mouse is 0.

Remarks:
"Umbrella" event.

Definition at line 238 of file eventnames.h.

#define csevMouseClick ( reg,
 )     csevMouseOp ((reg), (x), "button.click")

Click event from mouse x.

The default system mouse is 0.

Definition at line 256 of file eventnames.h.

#define csevMouseDoubleClick ( reg,
 )     csevMouseOp((reg), (x), "button.doubleclick")

Double-click event from mouse x.

The default system mouse is 0.

Definition at line 262 of file eventnames.h.

#define csevMouseDown ( reg,
 )     csevMouseOp ((reg), (x), "button.down")

Button down event from mouse x.

The default system mouse is 0.

Definition at line 244 of file eventnames.h.

#define csevMouseEvent ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.input.mouse"))

Generic mouse event.

All actual mouse events are children of this one.

Remarks:
"Umbrella" event.

Definition at line 200 of file eventnames.h.

#define csevMouseMove ( reg,
 )     csevMouseOp((reg), (x), "move")

Move event from mouse x.

The default system mouse is 0.

Definition at line 268 of file eventnames.h.

#define csevMouseUp ( reg,
 )     csevMouseOp ((reg), (x), "button.up")

Button up event from mouse x.

The default system mouse is 0.

Definition at line 250 of file eventnames.h.

#define csevQuit ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.application.quit"))

This event causes system driver to quit the event loop, even if the event loop has been entered multiple times.

The quit condition is never reset thus even if you call Loop again, the system driver will quit immediately. Such broadcasts are posted for irreversible finalization of the application such as when user closes the application window.

Definition at line 371 of file eventnames.h.

#define csevSystemClose ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.application.close"))

This event is broadcasted to all event listeners just before modules are about to be shutdown and unloaded (that is, the system is shutting down).

Definition at line 415 of file eventnames.h.

#define csevSystemOpen ( reg   )     (csEventNameRegistry::GetID((reg), "crystalspace.application.open"))

This event is broadcasted to all event listeners just after all modules have been initialized.

NOTE - it is not (usually) a good idea to load other modules in the csevSystemOpen event handler, particularly if the so-loaded module will itself depend on receiving csevSystemOpen. (Its its subscription ordering criteria may render it unloadable once delivery of this event has begun.) Instead, modules which will need to receive csevSystemOpen should be loaded inside of other modules' Initialize() methods.

Definition at line 408 of file eventnames.h.


Typedef Documentation

A csEventID is a handle for a string representing an event's hierarchical name (e.g., "crystalspace.input.keyboard.down").

Definition at line 38 of file eventnames.h.

Keyboard event type - stored as keyEventType attribute in keyboard events.

Mouse event type - stored as mEventType attribute in mouse events.


Enumeration Type Documentation

Keyboard event type - stored as keyEventType attribute in keyboard events.

Enumerator:
csKeyEventTypeUp 

A 'key up' event.

csKeyEventTypeDown 

A 'key down' event.

Definition at line 45 of file evdefs.h.

Mouse event type - stored as mEventType attribute in mouse events.

Enumerator:
csMouseEventTypeMove 

A motion event.

csMouseEventTypeUp 

A 'button up' event.

csMouseEventTypeDown 

A 'button down' event.

csMouseEventTypeClick 

A 'click' event.

csMouseEventTypeDoubleClick 

A 'doubleclick' event.

Definition at line 54 of file evdefs.h.

Various attribute data types supported by the event system (iEvent).

Enumerator:
csEventAttrUnknown 

The attribute type is unknown.

This shouldn't occur.

csEventAttrInt 

A signed integer is contained.

csEventAttrUInt 

An unsigned integer is contained.

csEventAttrFloat 

A floating point number is contained.

csEventAttrDatabuffer 

A string or raw data buffer is contained.

csEventAttrEvent 

An iEvent is contained.

csEventAttriBase 

An iBase interface is contained.

csEventAttrRawPtr 

A raw pointer is contained.

Definition at line 242 of file event.h.

Error codes for event attribute retrieval.

Enumerator:
csEventErrNone 

No error.

csEventErrLossy 

The attribute value could be converted to the requested type, however, data was lost during the conversion.

csEventErrNotFound 

The requested attribute was not found.

csEventErrMismatchInt 

The contained value can not be converted to the requested type.

The error code indicates the actual contained type.

csEventErrMismatchUInt 

The contained value can not be converted to the requested type.

The error code indicates the actual contained type.

csEventErrMismatchFloat 

The contained value can not be converted to the requested type.

The error code indicates the actual contained type.

csEventErrMismatchBuffer 

The contained value can not be converted to the requested type.

The error code indicates the actual contained type.

csEventErrMismatchEvent 

The contained value can not be converted to the requested type.

The error code indicates the actual contained type.

csEventErrMismatchIBase 

The contained value can not be converted to the requested type.

The error code indicates the actual contained type.

csEventErrUhOhUnknown 

Unknown error.

Something doesn't work like it should.

Definition at line 212 of file event.h.

Results for attempts to process a character key.

Enumerator:
csComposeNoChar 

No character could be retrieved. Possibly the key was dead.

csComposeNormalChar 

A single, normal chararacter is retrieved.

csComposeComposedChar 

A single, composed chararacter is retrieved.

csComposeUncomposeable 

A key couldn't be combined with a previously pressed dead key, and both characters are returned individually.

Definition at line 43 of file csinput.h.

Constants for mouse buttons.

Note: the possibly occuring values are not limited to those below, e.g. maybe some day 6-button mice are available...

Enumerator:
csmbNone 

ID to designate the absence of an acting mouse button.

csmbLeft 

Left button.

csmbRight 

Right button.

csmbMiddle 

Middle button.

csmbWheelUp 

Wheel was scrolled up.

csmbWheelDown 

Wheel was scrolled down.

csmbExtra1 

Thumb button 1 (e.g. on 5-button mice).

csmbExtra2 

Thumb button 2 (e.g. on 5-button mice).

csmbHWheelLeft 

Horizontal wheel was scrolled left.

csmbHWheelRight 

Horizontal wheel was scrolled right.

Definition at line 73 of file evdefs.h.


Function Documentation

static csEventID csevCanvasOp ( iObjectRegistry object_reg,
const iGraphics2D g2d,
const csString y 
) [inline, static]

Check if an event is any input event.

Definition at line 424 of file eventnames.h.

csEventID csevCanvasOp ( csRef< iEventNameRegistry > &  reg,
const iGraphics2D g2d,
const csString y 
)

Check if an event is any input event.

static csEventID csevJoystick ( iObjectRegistry object_reg,
uint  x 
) [inline, static]

Check if an event is any input event.

Definition at line 288 of file eventnames.h.

static csEventID csevJoystick ( iEventNameRegistry name_reg,
uint  x 
) [inline, static]

Check if an event is any input event.

Definition at line 279 of file eventnames.h.

static csEventID csevJoystickOp ( iObjectRegistry object_reg,
uint  x,
const csString y 
) [inline, static]

Check if an event is any input event.

Definition at line 304 of file eventnames.h.

static csEventID csevJoystickOp ( iEventNameRegistry name_reg,
uint  x,
const csString y 
) [inline, static]

Check if an event is any input event.

Definition at line 294 of file eventnames.h.

static csEventID csevMouse ( iObjectRegistry object_reg,
uint  x 
) [inline, static]

Check if an event is any input event.

Definition at line 211 of file eventnames.h.

static csEventID csevMouse ( iEventNameRegistry name_reg,
uint  x 
) [inline, static]

Check if an event is any input event.

Definition at line 203 of file eventnames.h.

static csEventID csevMouseOp ( iObjectRegistry object_reg,
uint  x,
const csString y 
) [inline, static]

Check if an event is any input event.

Definition at line 227 of file eventnames.h.

static csEventID csevMouseOp ( iEventNameRegistry name_reg,
uint  x,
const csString y 
) [inline, static]

Check if an event is any input event.

Definition at line 217 of file eventnames.h.


Generated for Crystal Space 2.0 by doxygen 1.6.1