FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::JoystickEvent Class Reference

Class for Joystick events. More...

#include <joystickevent.h>

+ Inheritance diagram for FIFE::JoystickEvent:
+ Collaboration diagram for FIFE::JoystickEvent:

Public Types

Public Member Functions

 JoystickEvent ()
 Constructor. More...
 
virtual ~JoystickEvent ()
 Destructor. More...
 
JoystickEventType getType () const
 Return the event type. More...
 
void setType (JoystickEventType type)
 Sets the event type. More...
 
int32_t getInstanceId () const
 Return the instance id of the joystick. More...
 
void setInstanceId (int32_t id)
 Sets the instance id of the joystick. More...
 
int8_t getAxis () const
 Return the index number of axis for joystick, or the Joystick::ContollerAxis for controller. More...
 
void setAxis (int8_t axis)
 Sets the axis index number or the Joystick::ControllerAxis. More...
 
float getAxisValue () const
 Return the axis value, range is -1.0 to 1.0. More...
 
void setAxisValue (float value)
 Sets the axis value. More...
 
int8_t getHat () const
 Return the hat index. More...
 
void setHat (int8_t hat)
 Sets the hat index. More...
 
int8_t getHatValue () const
 Return the hat value, see Joystick::Hat. More...
 
void setHatValue (int8_t value)
 Sets the hat value. More...
 
int8_t getButton () const
 Return the button index for joystick, or Joystick::ControllerButton for controller. More...
 
void setButton (int8_t button)
 Sets the button index or Joystick::ControllerButton. More...
 
bool isController () const
 Return true if it is a controller, false if only a joystick. More...
 
void setController (bool value)
 Sets to true if the event is for a controller, otherwise false. More...
 
virtual void consume ()
 Marks events as consumed. More...
 
virtual bool isConsumed () const
 Checks whether event is consumed. More...
 
virtual void consumedByWidgets ()
 Marks events as consumed by widget library. More...
 
virtual bool isConsumedByWidgets () const
 Checks whether event is consumed by widget library. More...
 
virtual IEventSourcegetSource () const
 Gets the source of the event. More...
 
virtual void setSource (IEventSource *source)
 Sets the source of the event. More...
 
virtual int32_t getTimeStamp () const
 Gets the timestamp of the event. More...
 
virtual void setTimeStamp (int32_t timestamp)
 Sets the timestamp of the event. More...
 
virtual const std::string & getName () const
 Gets the name of the event. More...
 
virtual std::string getDebugString () const
 Gets the debugstring of the event. More...
 
- Public Member Functions inherited from FIFE::InputEvent
 InputEvent ()
 Constructor. More...
 
 ~InputEvent ()
 Destructor. More...
 
virtual bool isAltPressed () const
 Checks whether alt is pressed. More...
 
virtual void setAltPressed (bool pressed)
 Sets alt to pressed. More...
 
virtual bool isControlPressed () const
 Checks whether control is pressed. More...
 
virtual void setControlPressed (bool pressed)
 Sets control to pressed. More...
 
virtual bool isMetaPressed () const
 Checks whether meta is pressed. More...
 
virtual void setMetaPressed (bool pressed)
 Sets meta to pressed. More...
 
virtual bool isShiftPressed () const
 Checks whether shift is pressed. More...
 
virtual void setShiftPressed (bool pressed)
 Sets shift to pressed. More...
 
virtual std::string getAttrStr () const
 Gets attribute string of the event. More...
 
- Public Member Functions inherited from FIFE::Event
 Event ()
 Constructor. More...
 
virtual ~Event ()
 Destructor. More...
 

Private Attributes

JoystickEventType m_eventType
 Event type. More...
 
int32_t m_instanceId
 Joystick instance id. More...
 
int8_t m_axis
 Axis index. More...
 
float m_axisValue
 Axis value. More...
 
int8_t m_hat
 Hat index. More...
 
int8_t m_hatValue
 Hat value. More...
 
int8_t m_button
 Button index. More...
 
bool m_controller
 Is gamecontroller. More...
 

Detailed Description

Class for Joystick events.

Definition at line 45 of file joystickevent.h.

Member Enumeration Documentation

Enumerator
UNKNOWN_EVENT 
AXIS_MOTION 
HAT_MOTION 
BUTTON_PRESSED 
BUTTON_RELEASED 
DEVICE_ADDED 
DEVICE_REMOVED 

Definition at line 47 of file joystickevent.h.

Constructor & Destructor Documentation

FIFE::JoystickEvent::JoystickEvent ( )
inline

Constructor.

Definition at line 59 of file joystickevent.h.

virtual FIFE::JoystickEvent::~JoystickEvent ( )
inlinevirtual

Destructor.

Definition at line 72 of file joystickevent.h.

Member Function Documentation

virtual void FIFE::JoystickEvent::consume ( )
inlinevirtual

Marks events as consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 138 of file joystickevent.h.

References FIFE::InputEvent::consume().

virtual void FIFE::JoystickEvent::consumedByWidgets ( )
inlinevirtual

Marks events as consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 140 of file joystickevent.h.

References FIFE::InputEvent::consumedByWidgets().

int8_t FIFE::JoystickEvent::getAxis ( ) const
inline

Return the index number of axis for joystick, or the Joystick::ContollerAxis for controller.

Definition at line 92 of file joystickevent.h.

References m_axis.

float FIFE::JoystickEvent::getAxisValue ( ) const
inline

Return the axis value, range is -1.0 to 1.0.

Definition at line 100 of file joystickevent.h.

References m_axisValue.

int8_t FIFE::JoystickEvent::getButton ( ) const
inline

Return the button index for joystick, or Joystick::ControllerButton for controller.

Definition at line 124 of file joystickevent.h.

References m_button.

virtual std::string FIFE::JoystickEvent::getDebugString ( ) const
inlinevirtual

Gets the debugstring of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 151 of file joystickevent.h.

References FIFE::InputEvent::getDebugString().

int8_t FIFE::JoystickEvent::getHat ( ) const
inline

Return the hat index.

Definition at line 108 of file joystickevent.h.

References m_hat.

int8_t FIFE::JoystickEvent::getHatValue ( ) const
inline

Return the hat value, see Joystick::Hat.

Definition at line 116 of file joystickevent.h.

References m_hatValue.

int32_t FIFE::JoystickEvent::getInstanceId ( ) const
inline

Return the instance id of the joystick.

Definition at line 84 of file joystickevent.h.

References m_instanceId.

Referenced by FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

virtual const std::string& FIFE::JoystickEvent::getName ( ) const
inlinevirtual

Gets the name of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 147 of file joystickevent.h.

virtual IEventSource* FIFE::JoystickEvent::getSource ( ) const
inlinevirtual

Gets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 142 of file joystickevent.h.

References FIFE::InputEvent::getSource().

virtual int32_t FIFE::JoystickEvent::getTimeStamp ( ) const
inlinevirtual

Gets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 144 of file joystickevent.h.

References FIFE::InputEvent::getTimeStamp().

JoystickEventType FIFE::JoystickEvent::getType ( ) const
inline

Return the event type.

Definition at line 76 of file joystickevent.h.

References m_eventType.

Referenced by FIFE::JoystickManager::dispatchJoystickEvent().

+ Here is the caller graph for this function:

virtual bool FIFE::JoystickEvent::isConsumed ( ) const
inlinevirtual

Checks whether event is consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 139 of file joystickevent.h.

References FIFE::InputEvent::isConsumed().

virtual bool FIFE::JoystickEvent::isConsumedByWidgets ( ) const
inlinevirtual

Checks whether event is consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 141 of file joystickevent.h.

References FIFE::InputEvent::isConsumedByWidgets().

bool FIFE::JoystickEvent::isController ( ) const
inline

Return true if it is a controller, false if only a joystick.

Definition at line 132 of file joystickevent.h.

References m_controller.

void FIFE::JoystickEvent::setAxis ( int8_t  axis)
inline

Sets the axis index number or the Joystick::ControllerAxis.

Definition at line 96 of file joystickevent.h.

References m_axis.

Referenced by FIFE::JoystickManager::processControllerEvent(), and FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

void FIFE::JoystickEvent::setAxisValue ( float  value)
inline

Sets the axis value.

Definition at line 104 of file joystickevent.h.

References m_axisValue.

Referenced by FIFE::JoystickManager::processControllerEvent(), and FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

void FIFE::JoystickEvent::setButton ( int8_t  button)
inline

Sets the button index or Joystick::ControllerButton.

Definition at line 128 of file joystickevent.h.

References m_button.

Referenced by FIFE::JoystickManager::processControllerEvent(), and FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

void FIFE::JoystickEvent::setController ( bool  value)
inline

Sets to true if the event is for a controller, otherwise false.

Definition at line 136 of file joystickevent.h.

References m_controller.

Referenced by FIFE::JoystickManager::processControllerEvent(), and FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

void FIFE::JoystickEvent::setHat ( int8_t  hat)
inline

Sets the hat index.

Definition at line 112 of file joystickevent.h.

References m_hat.

Referenced by FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

void FIFE::JoystickEvent::setHatValue ( int8_t  value)
inline

Sets the hat value.

Definition at line 120 of file joystickevent.h.

References m_hatValue.

Referenced by FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

void FIFE::JoystickEvent::setInstanceId ( int32_t  id)
inline

Sets the instance id of the joystick.

Definition at line 88 of file joystickevent.h.

References m_instanceId.

Referenced by FIFE::JoystickManager::processControllerEvent(), and FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

virtual void FIFE::JoystickEvent::setSource ( IEventSource source)
inlinevirtual

Sets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 143 of file joystickevent.h.

References FIFE::InputEvent::setSource().

Referenced by FIFE::JoystickManager::processControllerEvent(), and FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

virtual void FIFE::JoystickEvent::setTimeStamp ( int32_t  timestamp)
inlinevirtual

Sets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 145 of file joystickevent.h.

References FIFE::InputEvent::setTimeStamp().

void FIFE::JoystickEvent::setType ( JoystickEventType  type)
inline

Sets the event type.

Definition at line 80 of file joystickevent.h.

References m_eventType.

Referenced by FIFE::JoystickManager::processControllerEvent(), and FIFE::JoystickManager::processJoystickEvent().

+ Here is the caller graph for this function:

Member Data Documentation

int8_t FIFE::JoystickEvent::m_axis
private

Axis index.

Definition at line 159 of file joystickevent.h.

Referenced by getAxis(), and setAxis().

float FIFE::JoystickEvent::m_axisValue
private

Axis value.

Definition at line 161 of file joystickevent.h.

Referenced by getAxisValue(), and setAxisValue().

int8_t FIFE::JoystickEvent::m_button
private

Button index.

Definition at line 167 of file joystickevent.h.

Referenced by getButton(), and setButton().

bool FIFE::JoystickEvent::m_controller
private

Is gamecontroller.

Definition at line 169 of file joystickevent.h.

Referenced by isController(), and setController().

JoystickEventType FIFE::JoystickEvent::m_eventType
private

Event type.

Definition at line 155 of file joystickevent.h.

Referenced by getType(), and setType().

int8_t FIFE::JoystickEvent::m_hat
private

Hat index.

Definition at line 163 of file joystickevent.h.

Referenced by getHat(), and setHat().

int8_t FIFE::JoystickEvent::m_hatValue
private

Hat value.

Definition at line 165 of file joystickevent.h.

Referenced by getHatValue(), and setHatValue().

int32_t FIFE::JoystickEvent::m_instanceId
private

Joystick instance id.

Definition at line 157 of file joystickevent.h.

Referenced by getInstanceId(), and setInstanceId().


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