##

MouseEvent.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_MOUSEEVENT_HH_
#define _GAZEBO_MOUSEEVENT_HH_
#include <ignition/math/Vector2.hh>
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace common
{
class MouseEventPrivate;
class GZ_COMMON_VISIBLE MouseEvent
{
public: enum MouseButton
{
NO_BUTTON = 0x0,
LEFT = 0x1,
MIDDLE = 0x2,
RIGHT = 0x4
};
public: enum EventType
{
NO_EVENT,
MOVE,
PRESS,
RELEASE,
SCROLL
};
public: MouseEvent();
public: MouseEvent(const MouseEvent &_other);
public: virtual ~MouseEvent();
public: ignition::math::Vector2i Pos() const;
public: void SetPos(const ignition::math::Vector2i &_pos);
public: void SetPos(const int _x, const int _y);
public: ignition::math::Vector2i PrevPos() const;
public: void SetPrevPos(const ignition::math::Vector2i &_pos);
public: void SetPrevPos(const int _x, const int _y);
public: ignition::math::Vector2i PressPos() const;
public: void SetPressPos(const ignition::math::Vector2i &_pos);
public: void SetPressPos(const int _x, const int _y);
public: ignition::math::Vector2i Scroll() const;
public: void SetScroll(const ignition::math::Vector2i &_scroll);
public: void SetScroll(const int _x, const int _y);
public: float MoveScale() const;
public: void SetMoveScale(const float _scale);
public: bool Dragging() const;
public: void SetDragging(const bool _dragging);
public: EventType Type() const;
public: void SetType(const EventType _type) const;
public: MouseEvent::MouseButton Button() const;
public: void SetButton(const MouseEvent::MouseButton _button) const;
public: unsigned int Buttons() const;
public: void SetButtons(const unsigned int &_buttons);
public: bool Shift() const;
public: void SetShift(const bool _shift) const;
public: bool Alt() const;
public: void SetAlt(const bool _alt);
public: bool Control() const;
public: void SetControl(const bool _control) const;
public: MouseEvent &operator=(const MouseEvent &_other);
private: MouseEventPrivate *dataPtr;
};
}
}
#endif
gazebo::common::MouseEvent::MIDDLE
Middle button.
Definition: MouseEvent.hh:47
gazebo::common::MouseEvent::operator=
MouseEvent & operator=(const MouseEvent &_other)
Assignment operator.
gazebo::common::MouseEvent::RIGHT
Right button.
Definition: MouseEvent.hh:50
gazebo::common::MouseEvent::PrevPos
ignition::math::Vector2i PrevPos() const
Get the previous position.
gazebo::common::MouseEvent::MouseButton
MouseButton
Standard mouse buttons enumeration.
Definition: MouseEvent.hh:38
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::common::MouseEvent::Type
EventType Type() const
Get the event type.
gazebo::common::MouseEvent::Scroll
ignition::math::Vector2i Scroll() const
Get the scroll position.
gazebo::common::MouseEvent::SetControl
void SetControl(const bool _control) const
Set the control key press flag.
gazebo::common::MouseEvent::SCROLL
Scroll event.
Definition: MouseEvent.hh:69
gazebo::common::MouseEvent::NO_EVENT
No event.
Definition: MouseEvent.hh:57
common
common
Definition: FuelModelDatabase.hh:37
gazebo::common::MouseEvent::NO_BUTTON
No button.
Definition: MouseEvent.hh:41
gazebo::Tracks::RIGHT
gazebo::common::MouseEvent::Pos
ignition::math::Vector2i Pos() const
Get mouse pointer position on the screen.
system.hh
gazebo::common::MouseEvent::SetButton
void SetButton(const MouseEvent::MouseButton _button) const
Set the button which caused the event.
gazebo::common::MouseEvent::SetScroll
void SetScroll(const ignition::math::Vector2i &_scroll)
Set the scroll position.
gazebo::common::MouseEvent::SetButtons
void SetButtons(const unsigned int &_buttons)
Set the state of the buttons when the event was generated.
gazebo::common::MouseEvent::LEFT
Left button.
Definition: MouseEvent.hh:44
gazebo::common::MouseEvent::RELEASE
Release event.
Definition: MouseEvent.hh:66
gazebo::common::MouseEvent::PRESS
Press event.
Definition: MouseEvent.hh:63
gazebo::common::MouseEvent::Button
MouseEvent::MouseButton Button() const
Get the button which caused this event.
gazebo::common::MouseEvent::SetMoveScale
void SetMoveScale(const float _scale)
Set the scaling factor.
gazebo::common::MouseEvent::Control
bool Control() const
Get the control key press flag.
gazebo::common::MouseEvent::SetAlt
void SetAlt(const bool _alt)
Set the alt key press flag.
gazebo::common::MouseEvent::SetPressPos
void SetPressPos(const ignition::math::Vector2i &_pos)
Set the position of button press.
gazebo::common::MouseEvent::Alt
bool Alt() const
Get the alt key press flag.
gazebo::common::MouseEvent::SetType
void SetType(const EventType _type) const
Set the event type.
gazebo::common::MouseEvent::Buttons
unsigned int Buttons() const
Get the state of the buttons when the event was generated.
gazebo::common::MouseEvent::MoveScale
float MoveScale() const
Get the scaling factor.
gazebo::common::MouseEvent::MouseEvent
MouseEvent()
Constructor.
gazebo::common::MouseEvent::SetDragging
void SetDragging(const bool _dragging)
Set the flag for mouse drag motion.
gazebo::common::MouseEvent::SetPos
void SetPos(const ignition::math::Vector2i &_pos)
Set mouse pointer position on the screen.
gazebo::common::MouseEvent::EventType
EventType
Mouse event types enumeration.
Definition: MouseEvent.hh:54
gazebo::common::MouseEvent::~MouseEvent
virtual ~MouseEvent()
Destructor.
gazebo::Tracks::LEFT
gazebo::common::MouseEvent::MOVE
Move event.
Definition: MouseEvent.hh:60
gazebo::common::MouseEvent::Shift
bool Shift() const
Get the shift key press flag.
gazebo::common::MouseEvent::SetShift
void SetShift(const bool _shift) const
Set the shift key press flag.
gazebo::common::MouseEvent
Generic description of a mouse event.
Definition: MouseEvent.hh:35
gazebo::common::MouseEvent::SetPrevPos
void SetPrevPos(const ignition::math::Vector2i &_pos)
Set the previous position.
gazebo::common::MouseEvent::PressPos
ignition::math::Vector2i PressPos() const
Get the position of button press.
gazebo::common::MouseEvent::Dragging
bool Dragging() const
Get the flag for mouse drag motion.