19 #include <mitkWheelEvent.h>
28 p[0] = mouseEvent->x();
29 p[1] = mouseEvent->y();
31 int modifiers = mouseEvent->modifiers();
34 switch (mouseEvent->type())
36 case QEvent::MouseButtonRelease:
37 state |= mouseEvent->button();
39 case QEvent::MouseMove:
40 state |= mouseEvent->buttons();
46 if (modifiers & Qt::ShiftModifier)
48 if (modifiers & Qt::ControlModifier)
50 if (modifiers & Qt::AltModifier)
52 if (modifiers & Qt::MetaModifier)
54 if (modifiers & Qt::KeypadModifier)
57 mitk::MouseEvent mitkEvent(sender, mouseEvent->type(), mouseEvent->button(),
67 p[0] = wheelEvent->x();
68 p[1] = wheelEvent->y();
70 int modifiers = wheelEvent->modifiers();
73 state = wheelEvent->buttons();
75 if (modifiers & Qt::ShiftModifier)
77 if (modifiers & Qt::ControlModifier)
79 if (modifiers & Qt::AltModifier)
81 if (modifiers & Qt::MetaModifier)
83 if (modifiers & Qt::KeypadModifier)
86 mitk::WheelEvent mitkEvent(sender, wheelEvent->type(), wheelEvent->buttons(),
96 int key = keyEvent->key();
99 if (key >= 0x01000000 && key <= 0x01000060)
100 key -= (0x01000000 - 0x1000);
101 else if(key >= 0x01001120 && key <= 0x01001262)
108 int modifiers = keyEvent->modifiers();
110 if (modifiers & Qt::ShiftModifier)
112 if (modifiers & Qt::ControlModifier)
114 if (modifiers & Qt::AltModifier)
116 if (modifiers & Qt::MetaModifier)
121 mitk::KeyEvent mke(sender, keyEvent->type(),
mitk::BS_NoButton, state, key, keyEvent->text().toStdString(), p);
Organizes the rendering process.
static mitk::WheelEvent AdaptWheelEvent(mitk::BaseRenderer *sender, QWheelEvent *wheelEvent)
Constants for most interaction classes, due to the generic StateMachines.
static mitk::MouseEvent AdaptMouseEvent(mitk::BaseRenderer *sender, QMouseEvent *mouseEvent)
static mitk::KeyEvent AdaptKeyEvent(mitk::BaseRenderer *sender, QKeyEvent *keyEvent, const QPoint &point)