mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #4735 from jherico/menu_fix
Prevent the menu from coming up when alt is applied as a modifier to touch or mouse events
This commit is contained in:
commit
d7cc76e48b
1 changed files with 7 additions and 1 deletions
|
@ -1467,6 +1467,9 @@ void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) {
|
|||
}
|
||||
|
||||
void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) {
|
||||
// Inhibit the menu if the user is using alt-mouse dragging
|
||||
_altPressed = false;
|
||||
|
||||
if (!_aboutToQuit) {
|
||||
_entities.mousePressEvent(event, deviceID);
|
||||
}
|
||||
|
@ -1541,6 +1544,7 @@ void Application::mouseReleaseEvent(QMouseEvent* event, unsigned int deviceID) {
|
|||
}
|
||||
|
||||
void Application::touchUpdateEvent(QTouchEvent* event) {
|
||||
_altPressed = false;
|
||||
if (event->type() == QEvent::TouchUpdate) {
|
||||
TouchEvent thisEvent(*event, _lastTouchEvent);
|
||||
_controllerScriptingInterface.emitTouchUpdateEvent(thisEvent); // send events to any registered scripts
|
||||
|
@ -1576,6 +1580,7 @@ void Application::touchUpdateEvent(QTouchEvent* event) {
|
|||
}
|
||||
|
||||
void Application::touchBeginEvent(QTouchEvent* event) {
|
||||
_altPressed = false;
|
||||
TouchEvent thisEvent(*event); // on touch begin, we don't compare to last event
|
||||
_controllerScriptingInterface.emitTouchBeginEvent(thisEvent); // send events to any registered scripts
|
||||
|
||||
|
@ -1590,6 +1595,7 @@ void Application::touchBeginEvent(QTouchEvent* event) {
|
|||
}
|
||||
|
||||
void Application::touchEndEvent(QTouchEvent* event) {
|
||||
_altPressed = false;
|
||||
TouchEvent thisEvent(*event, _lastTouchEvent);
|
||||
_controllerScriptingInterface.emitTouchEndEvent(thisEvent); // send events to any registered scripts
|
||||
_lastTouchEvent = thisEvent;
|
||||
|
@ -1606,7 +1612,7 @@ void Application::touchEndEvent(QTouchEvent* event) {
|
|||
}
|
||||
|
||||
void Application::wheelEvent(QWheelEvent* event) {
|
||||
|
||||
_altPressed = false;
|
||||
_controllerScriptingInterface.emitWheelEvent(event); // send events to any registered scripts
|
||||
|
||||
// if one of our scripts have asked to capture this event, then stop processing it
|
||||
|
|
Loading…
Reference in a new issue