All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Public Attributes | Protected Attributes
CEvent Class Reference

Base CEvent class for mapper events. More...

Inheritance diagram for CEvent:
CContinuousEvent CTriggeredEvent CJAxisEvent CHandlerEvent CJButtonEvent CJHatEvent CKeyEvent CModEvent

List of all members.

Public Types

enum  event_type { event_t = 0, handler_event_t }
 Type of CEvent class, if the code needs to use the specific type. More...

Public Member Functions

 CEvent (char const *const _entry, const enum event_type _type=event_t)
 CEvent constructor.
virtual std::string GetBindMenuText (void)
 Retrieve binding string for display in the menu.
void update_menu_shortcut (void)
 Update the menu item for the mapper shortcut with the latest text and keyboard shortcut.
void AddBind (CBind *bind)
 Add binding to the bindlist.
virtual void Active (bool yesno)
 Change whether the event is activated or not.
virtual void ActivateEvent (bool ev_trigger, bool skip_action)=0
 Activate the event, act on it.
virtual void DeActivateEvent (bool ev_trigger)=0
 Deactivate the event.
void DeActivateAll (void)
 Deactivate all bindings.
void SetValue (Bits value)
 Set the value of the event (such as joystick position)
Bits GetValue (void)
 Get the value of the event.
char * GetName (void)
 Retrieve the name of the event.
virtual bool IsTrigger (void)=0
 Indicate whether the event is a trigger or continuous input.

Public Attributes

std::string eventname
 Event name.
enum event_type type
 event type
CBindList bindlist
 Bind list to trigger on activation/deactivation.
bool active
 Whether the event is active or not.

Protected Attributes

Bitu activity
 Activity counter.
char entry [16]
 Mapper entry name.
Bits current_value
 Current value of the event (such as joystick position)

Detailed Description

Base CEvent class for mapper events.

Definition at line 121 of file sdl_mapper.cpp.

Member Enumeration Documentation

Type of CEvent class, if the code needs to use the specific type.

This is used by other parts of the mapper if it needs to retrieve additional information that is only provided by the handler event class

Definition at line 127 of file sdl_mapper.cpp.

Constructor & Destructor Documentation

CEvent::CEvent ( char const *const  _entry,
const enum event_type  _type = event_t 
) [inline]

CEvent constructor.

This constructor takes a mapper entry name and event type. Subclasses will call down to this constructor as well. The handler event class will fill in the _type field to identify itself.

Definition at line 138 of file sdl_mapper.cpp.

References active, activity, bindlist, current_value, entry, and type.

Member Function Documentation

std::string CEvent::GetBindMenuText ( void  ) [virtual]

Retrieve binding string for display in the menu.

Retrieve text string to show as the assigned mapper binding in a menu item's displayable area so that the user knows what keyboard input will trigger the shortcut.

Definition at line 735 of file sdl_mapper.cpp.

References bindlist, CKeyBind::GetBindMenuText(), and CBind::type.

Referenced by CBind::GetModifierText(), and update_menu_shortcut().

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