30 #ifndef VIEWPORT_MOUSE_EVENT_H 31 #define VIEWPORT_MOUSE_EVENT_H 33 #include <QMouseEvent> 34 #include <QWheelEvent> 59 , acting_button( e->button() )
60 , buttons_down( e->buttons() )
61 , modifiers( e->modifiers() )
77 , wheel_delta( e->delta() )
78 , acting_button( Qt::NoButton )
79 , buttons_down( e->buttons() )
80 , modifiers( e->modifiers() )
89 bool left() {
return buttons_down & Qt::LeftButton; }
90 bool middle() {
return buttons_down & Qt::MidButton; }
91 bool right() {
return buttons_down & Qt::RightButton; }
93 bool shift() {
return modifiers & Qt::ShiftModifier; }
94 bool control() {
return modifiers & Qt::ControlModifier; }
95 bool alt() {
return modifiers & Qt::AltModifier; }
99 bool leftUp() {
return type == QEvent::MouseButtonRelease && acting_button == Qt::LeftButton; }
100 bool middleUp() {
return type == QEvent::MouseButtonRelease && acting_button == Qt::MidButton; }
101 bool rightUp() {
return type == QEvent::MouseButtonRelease && acting_button == Qt::RightButton; }
103 bool leftDown() {
return type == QEvent::MouseButtonPress && acting_button == Qt::LeftButton; }
104 bool middleDown() {
return type == QEvent::MouseButtonPress && acting_button == Qt::MidButton; }
105 bool rightDown() {
return type == QEvent::MouseButtonPress && acting_button == Qt::RightButton; }
122 #endif // VIEWPORT_MOUSE_EVENT_H
Qt::KeyboardModifiers modifiers
ViewportMouseEvent(RenderPanel *p, Ogre::Viewport *vp, QWheelEvent *e, int lx, int ly)
ViewportMouseEvent(RenderPanel *p, Ogre::Viewport *vp, QMouseEvent *e, int lx, int ly)
Ogre::Viewport * viewport
TFSIMD_FORCE_INLINE const tfScalar & y() const
TFSIMD_FORCE_INLINE const tfScalar & x() const
Qt::MouseButton acting_button
Qt::MouseButtons buttons_down