FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::MouseEvent Class Reference

Class for mouse events. More...

#include <mouseevent.h>

+ Inheritance diagram for FIFE::MouseEvent:
+ Collaboration diagram for FIFE::MouseEvent:

Public Types

enum  MouseEventType {
  UNKNOWN_EVENT = -1, MOVED = 0, PRESSED, RELEASED,
  WHEEL_MOVED_DOWN, WHEEL_MOVED_UP, WHEEL_MOVED_RIGHT, WHEEL_MOVED_LEFT,
  CLICKED, ENTERED, EXITED, DRAGGED
}
 Mouse event types. More...
 
enum  MouseButtonType {
  EMPTY = 0, LEFT = 1, RIGHT = 2, MIDDLE = 4,
  X1 = 8, X2 = 16, UNKNOWN_BUTTON = 32
}
 Mouse button types. More...
 

Public Member Functions

 MouseEvent ()
 Constructor. More...
 
virtual ~MouseEvent ()
 Destructor. More...
 
MouseButtonType getButton () const
 Gets the button of the mouse event. More...
 
void setButton (MouseButtonType type)
 
MouseEventType getType () const
 Gets the type of the event. More...
 
void setType (MouseEventType type)
 
int32_t getX () const
 Gets the x coordinate of the mouse event. More...
 
void setX (int32_t x)
 
int32_t getY () const
 Gets the y coordinate of the mouse event. More...
 
void setY (int32_t y)
 
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 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...
 
virtual std::string getAttrStr () const
 Gets attribute string of the event. More...
 
- Public Member Functions inherited from FIFE::InputEvent
 InputEvent ()
 Constructor. More...
 
 ~InputEvent ()
 Destructor. More...
 
- Public Member Functions inherited from FIFE::Event
 Event ()
 Constructor. More...
 
virtual ~Event ()
 Destructor. More...
 

Static Public Member Functions

static std::string mouseEventType2str (MouseEventType t)
 Returns string representation of given event type. More...
 
static std::string mouseButtonType2str (MouseButtonType t)
 Returns string representation of given button type. More...
 

Private Attributes

MouseEventType m_eventType
 
MouseButtonType m_buttonType
 
int32_t m_x
 
int32_t m_y
 

Detailed Description

Class for mouse events.

Definition at line 42 of file mouseevent.h.

Member Enumeration Documentation

◆ MouseButtonType

Mouse button types.

Enumerator
EMPTY 
LEFT 
RIGHT 
MIDDLE 
X1 
X2 
UNKNOWN_BUTTON 

Definition at line 66 of file mouseevent.h.

◆ MouseEventType

Mouse event types.

Enumerator
UNKNOWN_EVENT 
MOVED 
PRESSED 
RELEASED 
WHEEL_MOVED_DOWN 
WHEEL_MOVED_UP 
WHEEL_MOVED_RIGHT 
WHEEL_MOVED_LEFT 
CLICKED 
ENTERED 
EXITED 
DRAGGED 

Definition at line 47 of file mouseevent.h.

Constructor & Destructor Documentation

◆ MouseEvent()

FIFE::MouseEvent::MouseEvent ( )
inline

Constructor.

Definition at line 80 of file mouseevent.h.

◆ ~MouseEvent()

virtual FIFE::MouseEvent::~MouseEvent ( )
inlinevirtual

Destructor.

Definition at line 89 of file mouseevent.h.

Member Function Documentation

◆ consume()

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

Marks events as consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 130 of file mouseevent.h.

References FIFE::InputEvent::consume().

◆ consumedByWidgets()

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

Marks events as consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 132 of file mouseevent.h.

References FIFE::InputEvent::consumedByWidgets().

Referenced by FIFE::EventManager::processMouseEvent().

+ Here is the caller graph for this function:

◆ getAttrStr()

virtual std::string FIFE::MouseEvent::getAttrStr ( ) const
inlinevirtual

Gets attribute string of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 144 of file mouseevent.h.

References FIFE::InputEvent::getAttrStr(), m_buttonType, m_eventType, m_x, m_y, mouseButtonType2str(), and mouseEventType2str().

◆ getButton()

MouseButtonType FIFE::MouseEvent::getButton ( ) const
inline

Gets the button of the mouse event.

Returns
the button of the mouse event.

Definition at line 95 of file mouseevent.h.

References m_buttonType.

Referenced by FIFE::EventManager::processMouseEvent().

+ Here is the caller graph for this function:

◆ getDebugString()

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

Gets the debugstring of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 143 of file mouseevent.h.

References FIFE::InputEvent::getDebugString().

◆ getName()

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

Gets the name of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 139 of file mouseevent.h.

◆ getSource()

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

Gets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 134 of file mouseevent.h.

References FIFE::InputEvent::getSource().

◆ getTimeStamp()

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

Gets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 136 of file mouseevent.h.

References FIFE::InputEvent::getTimeStamp().

◆ getType()

MouseEventType FIFE::MouseEvent::getType ( ) const
inline

Gets the type of the event.

Returns
the type of the event.

Definition at line 102 of file mouseevent.h.

References m_eventType.

Referenced by FIFE::EventManager::dispatchMouseEvent(), and FIFE::EventManager::fillMouseEvent().

+ Here is the caller graph for this function:

◆ getX()

int32_t FIFE::MouseEvent::getX ( ) const
inline

Gets the x coordinate of the mouse event.

The coordinate is relative to the source event source.

Returns
the x coordinate of the mouse event.

Definition at line 110 of file mouseevent.h.

References m_x.

◆ getY()

int32_t FIFE::MouseEvent::getY ( ) const
inline

Gets the y coordinate of the mouse event.

The coordinate is relative to the source event source.

Returns
the y coordinate of the mouse event.

Definition at line 118 of file mouseevent.h.

References m_y.

◆ isAltPressed()

virtual bool FIFE::MouseEvent::isAltPressed ( ) const
inlinevirtual

Checks whether alt is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 121 of file mouseevent.h.

References FIFE::InputEvent::isAltPressed().

◆ isConsumed()

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

Checks whether event is consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 131 of file mouseevent.h.

References FIFE::InputEvent::isConsumed().

Referenced by FIFE::EventManager::dispatchMouseEvent().

+ Here is the caller graph for this function:

◆ isConsumedByWidgets()

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

Checks whether event is consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 133 of file mouseevent.h.

References FIFE::InputEvent::isConsumedByWidgets().

Referenced by FIFE::EventManager::dispatchMouseEvent().

+ Here is the caller graph for this function:

◆ isControlPressed()

virtual bool FIFE::MouseEvent::isControlPressed ( ) const
inlinevirtual

Checks whether control is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 123 of file mouseevent.h.

References FIFE::InputEvent::isControlPressed().

◆ isMetaPressed()

virtual bool FIFE::MouseEvent::isMetaPressed ( ) const
inlinevirtual

Checks whether meta is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 125 of file mouseevent.h.

References FIFE::InputEvent::isMetaPressed().

◆ isShiftPressed()

virtual bool FIFE::MouseEvent::isShiftPressed ( ) const
inlinevirtual

Checks whether shift is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 127 of file mouseevent.h.

References FIFE::InputEvent::isShiftPressed().

◆ mouseButtonType2str()

static std::string FIFE::MouseEvent::mouseButtonType2str ( MouseButtonType  t)
inlinestatic

Returns string representation of given button type.

Definition at line 200 of file mouseevent.h.

References EMPTY, LEFT, MIDDLE, RIGHT, UNKNOWN_BUTTON, X1, and X2.

Referenced by getAttrStr().

+ Here is the caller graph for this function:

◆ mouseEventType2str()

static std::string FIFE::MouseEvent::mouseEventType2str ( MouseEventType  t)
inlinestatic

Returns string representation of given event type.

Definition at line 156 of file mouseevent.h.

References CLICKED, DRAGGED, ENTERED, EXITED, MOVED, PRESSED, RELEASED, WHEEL_MOVED_DOWN, WHEEL_MOVED_LEFT, WHEEL_MOVED_RIGHT, and WHEEL_MOVED_UP.

Referenced by getAttrStr().

+ Here is the caller graph for this function:

◆ setAltPressed()

virtual void FIFE::MouseEvent::setAltPressed ( bool  pressed)
inlinevirtual

Sets alt to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 122 of file mouseevent.h.

References FIFE::InputEvent::setAltPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

◆ setButton()

void FIFE::MouseEvent::setButton ( MouseButtonType  type)
inline

Definition at line 96 of file mouseevent.h.

References m_buttonType.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

◆ setControlPressed()

virtual void FIFE::MouseEvent::setControlPressed ( bool  pressed)
inlinevirtual

Sets control to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 124 of file mouseevent.h.

References FIFE::InputEvent::setControlPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

◆ setMetaPressed()

virtual void FIFE::MouseEvent::setMetaPressed ( bool  pressed)
inlinevirtual

Sets meta to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 126 of file mouseevent.h.

References FIFE::InputEvent::setMetaPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

◆ setShiftPressed()

virtual void FIFE::MouseEvent::setShiftPressed ( bool  pressed)
inlinevirtual

Sets shift to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 128 of file mouseevent.h.

References FIFE::InputEvent::setShiftPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

◆ setSource()

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

Sets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 135 of file mouseevent.h.

References FIFE::InputEvent::setSource().

Referenced by FIFE::EventManager::processMouseEvent().

+ Here is the caller graph for this function:

◆ setTimeStamp()

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

Sets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 137 of file mouseevent.h.

References FIFE::InputEvent::setTimeStamp().

◆ setType()

void FIFE::MouseEvent::setType ( MouseEventType  type)
inline

Definition at line 103 of file mouseevent.h.

References m_eventType.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

◆ setX()

void FIFE::MouseEvent::setX ( int32_t  x)
inline

Definition at line 111 of file mouseevent.h.

References m_x.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

◆ setY()

void FIFE::MouseEvent::setY ( int32_t  y)
inline

Definition at line 119 of file mouseevent.h.

References m_y.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_buttonType

MouseButtonType FIFE::MouseEvent::m_buttonType
private

Definition at line 234 of file mouseevent.h.

Referenced by getAttrStr(), getButton(), and setButton().

◆ m_eventType

MouseEventType FIFE::MouseEvent::m_eventType
private

Definition at line 233 of file mouseevent.h.

Referenced by getAttrStr(), getType(), and setType().

◆ m_x

int32_t FIFE::MouseEvent::m_x
private

Definition at line 235 of file mouseevent.h.

Referenced by getAttrStr(), getX(), and setX().

◆ m_y

int32_t FIFE::MouseEvent::m_y
private

Definition at line 236 of file mouseevent.h.

Referenced by getAttrStr(), getY(), and setY().


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