FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Class for Joystick events. More...
#include <joystickevent.h>
Public Types | |
enum | JoystickEventType { UNKNOWN_EVENT = 0, AXIS_MOTION, HAT_MOTION, BUTTON_PRESSED, BUTTON_RELEASED, DEVICE_ADDED, DEVICE_REMOVED } |
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 IEventSource * | getSource () 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... | |
Class for Joystick events.
Definition at line 45 of file joystickevent.h.
Enumerator | |
---|---|
UNKNOWN_EVENT | |
AXIS_MOTION | |
HAT_MOTION | |
BUTTON_PRESSED | |
BUTTON_RELEASED | |
DEVICE_ADDED | |
DEVICE_REMOVED |
Definition at line 47 of file joystickevent.h.
|
inline |
Constructor.
Definition at line 59 of file joystickevent.h.
|
inlinevirtual |
Destructor.
Definition at line 72 of file joystickevent.h.
|
inlinevirtual |
Marks events as consumed.
Reimplemented from FIFE::InputEvent.
Definition at line 138 of file joystickevent.h.
References FIFE::InputEvent::consume().
|
inlinevirtual |
Marks events as consumed by widget library.
Reimplemented from FIFE::InputEvent.
Definition at line 140 of file joystickevent.h.
References FIFE::InputEvent::consumedByWidgets().
|
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.
|
inline |
Return the axis value, range is -1.0 to 1.0.
Definition at line 100 of file joystickevent.h.
References m_axisValue.
|
inline |
Return the button index for joystick, or Joystick::ControllerButton for controller.
Definition at line 124 of file joystickevent.h.
References m_button.
|
inlinevirtual |
Gets the debugstring of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 151 of file joystickevent.h.
References FIFE::InputEvent::getDebugString().
|
inline |
|
inline |
Return the hat value, see Joystick::Hat.
Definition at line 116 of file joystickevent.h.
References m_hatValue.
|
inline |
Return the instance id of the joystick.
Definition at line 84 of file joystickevent.h.
References m_instanceId.
Referenced by FIFE::JoystickManager::processJoystickEvent().
|
inlinevirtual |
Gets the name of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 147 of file joystickevent.h.
|
inlinevirtual |
Gets the source of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 142 of file joystickevent.h.
References FIFE::InputEvent::getSource().
|
inlinevirtual |
Gets the timestamp of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 144 of file joystickevent.h.
References FIFE::InputEvent::getTimeStamp().
|
inline |
Return the event type.
Definition at line 76 of file joystickevent.h.
References m_eventType.
Referenced by FIFE::JoystickManager::dispatchJoystickEvent().
|
inlinevirtual |
Checks whether event is consumed.
Reimplemented from FIFE::InputEvent.
Definition at line 139 of file joystickevent.h.
References FIFE::InputEvent::isConsumed().
Referenced by FIFE::JoystickManager::dispatchJoystickEvent().
|
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().
|
inline |
Return true if it is a controller, false if only a joystick.
Definition at line 132 of file joystickevent.h.
References m_controller.
|
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().
|
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().
|
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().
|
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().
|
inline |
Sets the hat index.
Definition at line 112 of file joystickevent.h.
References m_hat.
Referenced by FIFE::JoystickManager::processJoystickEvent().
|
inline |
Sets the hat value.
Definition at line 120 of file joystickevent.h.
References m_hatValue.
Referenced by FIFE::JoystickManager::processJoystickEvent().
|
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().
|
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().
|
inlinevirtual |
Sets the timestamp of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 145 of file joystickevent.h.
References FIFE::InputEvent::setTimeStamp().
|
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().
|
private |
|
private |
Axis value.
Definition at line 161 of file joystickevent.h.
Referenced by getAxisValue(), and setAxisValue().
|
private |
Button index.
Definition at line 167 of file joystickevent.h.
Referenced by getButton(), and setButton().
|
private |
Is gamecontroller.
Definition at line 169 of file joystickevent.h.
Referenced by isController(), and setController().
|
private |
|
private |
|
private |
Hat value.
Definition at line 165 of file joystickevent.h.
Referenced by getHatValue(), and setHatValue().
|
private |
Joystick instance id.
Definition at line 157 of file joystickevent.h.
Referenced by getInstanceId(), and setInstanceId().