Planeshift
Public Types | Public Member Functions | Public Attributes | Static Public Attributes

psControl Struct Reference

Defines a generic button trigger. More...

#include <pscharcontrol.h>

List of all members.

Public Types

typedef const void * DataPtr
 Pointer to an object used by a TriggerFunction.
enum  Device { NONE, KEYBOARD, MOUSE }
enum  PressType { NORMAL, TOGGLE }
typedef void(psTriggerHandler::* TriggerFunction )(const psControl *, bool)
 Pointer to a member function in the psTriggerHandler class.

Public Member Functions

void Execute () const
 Does whatever this does.
 psControl (const char *n, PressType t, TriggerFunction f)
csString ToString () const
 Returns button combo in string form.

Public Attributes

uint button
 Button this is bound to.
DataPtr data
 Optional pointer to data needed by function.
Device device
 Location of button.
TriggerFunction function
 Function called when triggered.
uint32 mods
 Modifiers to go with the button.
csString name
 Name of this control.
bool state
 Is this active?
PressType type
 Trigger method.

Static Public Attributes

static psTriggerHandlerhandler
 Static pointer to the function handler class.

Detailed Description

Defines a generic button trigger.

Each game action that may be activated by a button press has a psControl object. (or 2, if a secondary trigger is created) These are managed by psControlManager which takes incoming CS input events and looks up any registered triggers Note that for shortcuts and secondary triggers the internal name listed in the object may differ from the display name which should be used in the GUI. The function GetDisplayName() may be used to convert the name. (ex: "Shortcut 1" -> "Greet")

Definition at line 49 of file pscharcontrol.h.


Member Typedef Documentation

typedef const void* psControl::DataPtr

Pointer to an object used by a TriggerFunction.

Definition at line 55 of file pscharcontrol.h.

typedef void(psTriggerHandler::* psControl::TriggerFunction)(const psControl *, bool)

Pointer to a member function in the psTriggerHandler class.

Definition at line 52 of file pscharcontrol.h.


Member Enumeration Documentation

Enumerator:
NONE 

Not set.

KEYBOARD 

Keypress.

MOUSE 

Mouseclick.

Definition at line 63 of file pscharcontrol.h.

Enumerator:
NORMAL 

Triggers on press and un-triggers on release.

TOGGLE 

Triggers on press and un-triggers on another press.

Definition at line 57 of file pscharcontrol.h.


Constructor & Destructor Documentation

psControl::psControl ( const char *  n,
PressType  t,
TriggerFunction  f 
) [inline]

Definition at line 70 of file pscharcontrol.h.


Member Function Documentation

void psControl::Execute ( ) const

Does whatever this does.

csString psControl::ToString ( ) const

Returns button combo in string form.


Member Data Documentation

Button this is bound to.

Definition at line 76 of file pscharcontrol.h.

Optional pointer to data needed by function.

Definition at line 80 of file pscharcontrol.h.

Location of button.

Definition at line 75 of file pscharcontrol.h.

Function called when triggered.

Definition at line 79 of file pscharcontrol.h.

Static pointer to the function handler class.

Definition at line 85 of file pscharcontrol.h.

Modifiers to go with the button.

Definition at line 77 of file pscharcontrol.h.

csString psControl::name

Name of this control.

Definition at line 73 of file pscharcontrol.h.

Is this active?

Definition at line 74 of file pscharcontrol.h.

Trigger method.

Definition at line 78 of file pscharcontrol.h.


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