22 #ifndef FIFE_EVENTCHANNEL_JOYSTICKEVENT_H 23 #define FIFE_EVENTCHANNEL_JOYSTICKEVENT_H 148 const static std::string eventName(
"JostickEvent");
JoystickEvent()
Constructor.
virtual const std::string & getName() const
Gets the name of the event.
virtual bool isConsumedByWidgets() const
Checks whether event is consumed by widget library.
int8_t m_button
Button index.
virtual bool isConsumed() const
Checks whether event is consumed.
virtual ~JoystickEvent()
Destructor.
void setHat(int8_t hat)
Sets the hat index.
void setAxis(int8_t axis)
Sets the axis index number or the Joystick::ControllerAxis.
int8_t getHatValue() const
Return the hat value, see Joystick::Hat.
virtual void consume()
Marks events as consumed.
int8_t getButton() const
Return the button index for joystick, or Joystick::ControllerButton for controller.
void setType(JoystickEventType type)
Sets the event type.
virtual std::string getDebugString() const
Gets the debugstring of the event.
void setInstanceId(int32_t id)
Sets the instance id of the joystick.
float getAxisValue() const
Return the axis value, range is -1.0 to 1.0.
virtual int32_t getTimeStamp() const
Gets the timestamp of the event.
int8_t m_hatValue
Hat value.
virtual IEventSource * getSource() const
Gets the source of the event.
void setController(bool value)
Sets to true if the event is for a controller, otherwise false.
int32_t m_instanceId
Joystick instance id.
int8_t getHat() const
Return the hat index.
virtual void setTimeStamp(int32_t timestamp)
Sets the timestamp of the event.
virtual void consumedByWidgets()
Marks events as consumed by widget library.
int8_t getAxis() const
Return the index number of axis for joystick, or the Joystick::ContollerAxis for controller.
Class for Joystick events.
bool m_controller
Is gamecontroller.
JoystickEventType m_eventType
Event type.
void setButton(int8_t button)
Sets the button index or Joystick::ControllerButton.
bool isController() const
Return true if it is a controller, false if only a joystick.
JoystickEventType getType() const
Return the event type.
void setHatValue(int8_t value)
Sets the hat value.
void setAxisValue(float value)
Sets the axis value.
Representation of event source (a thing sending events)
int32_t getInstanceId() const
Return the instance id of the joystick.
virtual void setSource(IEventSource *source)
Sets the source of the event.
float m_axisValue
Axis value.