Generic description of a mouse event. More...
#include <common/common.hh>
Public Types | |
enum | EventType { NO_EVENT, MOVE, PRESS, RELEASE, SCROLL } |
Mouse event types enumeration. More... | |
enum | MouseButton { NO_BUTTON = 0x0, LEFT = 0x1, MIDDLE = 0x2, RIGHT = 0x4 } |
Standard mouse buttons enumeration. More... | |
Public Member Functions | |
MouseEvent () | |
Constructor. More... | |
virtual | ~MouseEvent () |
Destructor. More... | |
bool | Alt () const |
Get the alt key press flag. More... | |
MouseEvent::MouseButton | Button () const |
Get the button which caused this event. More... | |
unsigned int | Buttons () const |
Get the state of the buttons when the event was generated. More... | |
bool | Control () const |
Get the control key press flag. More... | |
bool | Dragging () const |
Get the flag for mouse drag motion. More... | |
float | MoveScale () const |
Get the scaling factor. More... | |
ignition::math::Vector2i | Pos () const |
Get mouse pointer position on the screen. More... | |
ignition::math::Vector2i | PressPos () const |
Get the position of button press. More... | |
ignition::math::Vector2i | PrevPos () const |
Get the previous position. More... | |
ignition::math::Vector2i | Scroll () const |
Get the scroll position. More... | |
void | SetAlt (const bool _alt) |
Set the alt key press flag. More... | |
void | SetButton (const MouseEvent::MouseButton _button) const |
Set the button which caused the event. More... | |
void | SetButtons (const unsigned int &_buttons) |
Set the state of the buttons when the event was generated. More... | |
void | SetControl (const bool _control) const |
Set the control key press flag. More... | |
void | SetDragging (const bool _dragging) |
Set the flag for mouse drag motion. More... | |
void | SetMoveScale (const float _scale) |
Set the scaling factor. More... | |
void | SetPos (const ignition::math::Vector2i &_pos) |
Set mouse pointer position on the screen. More... | |
void | SetPos (const int _x, const int _y) |
Set mouse pointer position on the screen. More... | |
void | SetPressPos (const ignition::math::Vector2i &_pos) |
Set the position of button press. More... | |
void | SetPressPos (const int _x, const int _y) |
Set the position of button press. More... | |
void | SetPrevPos (const ignition::math::Vector2i &_pos) |
Set the previous position. More... | |
void | SetPrevPos (const int _x, const int _y) |
Set the previous position. More... | |
void | SetScroll (const ignition::math::Vector2i &_scroll) |
Set the scroll position. More... | |
void | SetScroll (const int _x, const int _y) |
Set the scroll position. More... | |
void | SetShift (const bool _shift) const |
Set the shift key press flag. More... | |
void | SetType (const EventType _type) const |
Set the event type. More... | |
bool | Shift () const |
Get the shift key press flag. More... | |
EventType | Type () const |
Get the event type. More... | |
Generic description of a mouse event.
gazebo::common::MouseEvent::MouseEvent | ( | ) |
Constructor.
|
virtual |
Destructor.
bool gazebo::common::MouseEvent::Alt | ( | ) | const |
Get the alt key press flag.
MouseEvent::MouseButton gazebo::common::MouseEvent::Button | ( | ) | const |
Get the button which caused this event.
unsigned int gazebo::common::MouseEvent::Buttons | ( | ) | const |
Get the state of the buttons when the event was generated.
bool gazebo::common::MouseEvent::Control | ( | ) | const |
Get the control key press flag.
bool gazebo::common::MouseEvent::Dragging | ( | ) | const |
Get the flag for mouse drag motion.
float gazebo::common::MouseEvent::MoveScale | ( | ) | const |
Get the scaling factor.
ignition::math::Vector2i gazebo::common::MouseEvent::Pos | ( | ) | const |
Get mouse pointer position on the screen.
ignition::math::Vector2i gazebo::common::MouseEvent::PressPos | ( | ) | const |
Get the position of button press.
ignition::math::Vector2i gazebo::common::MouseEvent::PrevPos | ( | ) | const |
Get the previous position.
ignition::math::Vector2i gazebo::common::MouseEvent::Scroll | ( | ) | const |
Get the scroll position.
void gazebo::common::MouseEvent::SetAlt | ( | const bool | _alt | ) |
Set the alt key press flag.
[in] | _alt | The alt key flag. |
void gazebo::common::MouseEvent::SetButton | ( | const MouseEvent::MouseButton | _button | ) | const |
Set the button which caused the event.
[in] | _button | The button which caused this event. |
void gazebo::common::MouseEvent::SetButtons | ( | const unsigned int & | _buttons | ) |
Set the state of the buttons when the event was generated.
[in] | _buttons | The state of the buttons, which can be a bitwise combination of MouseEvent::MouseButton. |
void gazebo::common::MouseEvent::SetControl | ( | const bool | _control | ) | const |
Set the control key press flag.
[in] | _control | The control key flag. |
void gazebo::common::MouseEvent::SetDragging | ( | const bool | _dragging | ) |
Set the flag for mouse drag motion.
[in] | _dragging | The dragging flag. |
void gazebo::common::MouseEvent::SetMoveScale | ( | const float | _scale | ) |
Set the scaling factor.
[in] | _scale | The move scaling factor. |
void gazebo::common::MouseEvent::SetPos | ( | const ignition::math::Vector2i & | _pos | ) |
Set mouse pointer position on the screen.
[in] | _pos | Mouse pointer position on the screen. |
void gazebo::common::MouseEvent::SetPos | ( | const int | _x, |
const int | _y | ||
) |
Set mouse pointer position on the screen.
[in] | _x | Mouse pointer X position on the screen. |
[in] | _y | Mouse pointer Y position on the screen. |
void gazebo::common::MouseEvent::SetPressPos | ( | const ignition::math::Vector2i & | _pos | ) |
Set the position of button press.
[in] | _pos | Mouse pointer position on the screen. |
void gazebo::common::MouseEvent::SetPressPos | ( | const int | _x, |
const int | _y | ||
) |
Set the position of button press.
[in] | _x | Mouse pointer X position on the screen. |
[in] | _y | Mouse pointer Y position on the screen. |
void gazebo::common::MouseEvent::SetPrevPos | ( | const ignition::math::Vector2i & | _pos | ) |
Set the previous position.
[in] | _pos | Previous mouse pointer position on the screen. |
void gazebo::common::MouseEvent::SetPrevPos | ( | const int | _x, |
const int | _y | ||
) |
Set the previous position.
[in] | _x | Previous mouse pointer X position on the screen. |
[in] | _y | Previous mouse pointer Y position on the screen. |
void gazebo::common::MouseEvent::SetScroll | ( | const ignition::math::Vector2i & | _scroll | ) |
Set the scroll position.
[in] | _scroll | Scroll position. |
void gazebo::common::MouseEvent::SetScroll | ( | const int | _x, |
const int | _y | ||
) |
Set the scroll position.
[in] | _x | Scroll X position. |
[in] | _y | Scroll Y position. |
void gazebo::common::MouseEvent::SetShift | ( | const bool | _shift | ) | const |
Set the shift key press flag.
[in] | _shift | The shift key press flag. |
void gazebo::common::MouseEvent::SetType | ( | const EventType | _type | ) | const |
Set the event type.
[in] | _type | The EventType. |
bool gazebo::common::MouseEvent::Shift | ( | ) | const |
Get the shift key press flag.
EventType gazebo::common::MouseEvent::Type | ( | ) | const |
Get the event type.