22 #ifndef FIFE_EVENTCHANNEL_MOUSEEVENT_H 23 #define FIFE_EVENTCHANNEL_MOUSEEVENT_H 140 const static std::string eventName(
"MouseEvent");
145 std::stringstream ss;
149 ss <<
"x = " <<
m_x <<
", ";
157 std::string s(
"unknown");
169 s =
"wheel_moved_down";
172 s =
"wheel_moved_up";
175 s =
"wheel_moved_right";
178 s =
"wheel_moved_left";
201 std::string s(
"unknown");
222 s =
"unknown button";
virtual bool isAltPressed() const
Checks whether alt is pressed.
MouseButtonType getButton() const
Gets the button of the mouse event.
virtual int32_t getTimeStamp() const
Gets the timestamp of the event.
virtual void setTimeStamp(int32_t timestamp)
Sets the timestamp of the event.
virtual void consume()
Marks events as consumed.
virtual bool isControlPressed() const
Checks whether control is pressed.
virtual std::string getDebugString() const
Gets the debugstring of the event.
virtual void setControlPressed(bool pressed)
Sets control to pressed.
virtual void setShiftPressed(bool pressed)
Sets shift to pressed.
virtual void setSource(IEventSource *source)
Sets the source of the event.
virtual std::string getAttrStr() const
Gets attribute string of the event.
virtual void setAltPressed(bool pressed)
Sets alt to pressed.
virtual bool isConsumedByWidgets() const
Checks whether event is consumed by widget library.
MouseEventType
Mouse event types.
int32_t getY() const
Gets the y coordinate of the mouse event.
virtual bool isShiftPressed() const
Checks whether shift is pressed.
MouseEventType getType() const
Gets the type of the event.
virtual ~MouseEvent()
Destructor.
MouseEventType m_eventType
virtual bool isConsumed() const
Checks whether event is consumed.
void setButton(MouseButtonType type)
virtual bool isMetaPressed() const
Checks whether meta is pressed.
virtual void setMetaPressed(bool pressed)
Sets meta to pressed.
MouseButtonType
Mouse button types.
virtual void consumedByWidgets()
Marks events as consumed by widget library.
static std::string mouseEventType2str(MouseEventType t)
Returns string representation of given event type.
void setType(MouseEventType type)
virtual IEventSource * getSource() const
Gets the source of the event.
static std::string mouseButtonType2str(MouseButtonType t)
Returns string representation of given button type.
MouseButtonType m_buttonType
Representation of event source (a thing sending events)
int32_t getX() const
Gets the x coordinate of the mouse event.
virtual const std::string & getName() const
Gets the name of the event.