FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Class for mouse events. More...
#include <mouseevent.h>
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 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... | |
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 |
Class for mouse events.
Definition at line 42 of file mouseevent.h.
Mouse button types.
Enumerator | |
---|---|
EMPTY | |
LEFT | |
RIGHT | |
MIDDLE | |
X1 | |
X2 | |
UNKNOWN_BUTTON |
Definition at line 66 of file mouseevent.h.
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.
|
inline |
Constructor.
Definition at line 80 of file mouseevent.h.
|
inlinevirtual |
Destructor.
Definition at line 89 of file mouseevent.h.
|
inlinevirtual |
Marks events as consumed.
Reimplemented from FIFE::InputEvent.
Definition at line 130 of file mouseevent.h.
References FIFE::InputEvent::consume().
|
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().
|
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().
|
inline |
Gets the button of the mouse event.
Definition at line 95 of file mouseevent.h.
References m_buttonType.
Referenced by FIFE::EventManager::processMouseEvent().
|
inlinevirtual |
Gets the debugstring of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 143 of file mouseevent.h.
References FIFE::InputEvent::getDebugString().
|
inlinevirtual |
Gets the name of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 139 of file mouseevent.h.
|
inlinevirtual |
Gets the source of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 134 of file mouseevent.h.
References FIFE::InputEvent::getSource().
|
inlinevirtual |
Gets the timestamp of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 136 of file mouseevent.h.
References FIFE::InputEvent::getTimeStamp().
|
inline |
Gets 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().
|
inline |
Gets the x coordinate of the mouse event.
The coordinate is relative to the source event source.
Definition at line 110 of file mouseevent.h.
References m_x.
|
inline |
Gets the y coordinate of the mouse event.
The coordinate is relative to the source event source.
Definition at line 118 of file mouseevent.h.
References m_y.
|
inlinevirtual |
Checks whether alt is pressed.
Reimplemented from FIFE::InputEvent.
Definition at line 121 of file mouseevent.h.
References FIFE::InputEvent::isAltPressed().
|
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().
|
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().
|
inlinevirtual |
Checks whether control is pressed.
Reimplemented from FIFE::InputEvent.
Definition at line 123 of file mouseevent.h.
References FIFE::InputEvent::isControlPressed().
|
inlinevirtual |
Checks whether meta is pressed.
Reimplemented from FIFE::InputEvent.
Definition at line 125 of file mouseevent.h.
References FIFE::InputEvent::isMetaPressed().
|
inlinevirtual |
Checks whether shift is pressed.
Reimplemented from FIFE::InputEvent.
Definition at line 127 of file mouseevent.h.
References FIFE::InputEvent::isShiftPressed().
|
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().
|
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().
|
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().
|
inline |
Definition at line 96 of file mouseevent.h.
References m_buttonType.
Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().
|
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().
|
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().
|
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().
|
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().
|
inlinevirtual |
Sets the timestamp of the event.
Reimplemented from FIFE::InputEvent.
Definition at line 137 of file mouseevent.h.
References FIFE::InputEvent::setTimeStamp().
|
inline |
Definition at line 103 of file mouseevent.h.
References m_eventType.
Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().
|
inline |
Definition at line 111 of file mouseevent.h.
References m_x.
Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().
|
inline |
Definition at line 119 of file mouseevent.h.
References m_y.
Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().
|
private |
Definition at line 234 of file mouseevent.h.
Referenced by getAttrStr(), getButton(), and setButton().
|
private |
Definition at line 233 of file mouseevent.h.
Referenced by getAttrStr(), getType(), and setType().
|
private |
Definition at line 235 of file mouseevent.h.
Referenced by getAttrStr(), getX(), and setX().
|
private |
Definition at line 236 of file mouseevent.h.
Referenced by getAttrStr(), getY(), and setY().