mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:58:09 +02:00
don't start/end action/back events on auto-repeat
This commit is contained in:
parent
a561252908
commit
477b5096e8
1 changed files with 20 additions and 12 deletions
|
@ -1118,18 +1118,22 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
_myAvatar->resetSize();
|
_myAvatar->resetSize();
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Space: {
|
case Qt::Key_Space: {
|
||||||
// this starts an HFActionEvent
|
if (!event->isAutoRepeat()) {
|
||||||
HFActionEvent startActionEvent(HFActionEvent::startType(), getViewportCenter());
|
// this starts an HFActionEvent
|
||||||
sendEvent(this, &startActionEvent);
|
HFActionEvent startActionEvent(HFActionEvent::startType(), getViewportCenter());
|
||||||
|
sendEvent(this, &startActionEvent);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Qt::Key_Escape: {
|
case Qt::Key_Escape: {
|
||||||
OculusManager::abandonCalibration();
|
OculusManager::abandonCalibration();
|
||||||
|
|
||||||
// this starts the HFCancelEvent
|
if (!event->isAutoRepeat()) {
|
||||||
HFBackEvent startBackEvent(HFBackEvent::startType());
|
// this starts the HFCancelEvent
|
||||||
sendEvent(this, &startBackEvent);
|
HFBackEvent startBackEvent(HFBackEvent::startType());
|
||||||
|
sendEvent(this, &startBackEvent);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1205,16 +1209,20 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
|
||||||
_myAvatar->clearDriveKeys();
|
_myAvatar->clearDriveKeys();
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Space: {
|
case Qt::Key_Space: {
|
||||||
// this ends the HFActionEvent
|
if (!event->isAutoRepeat()) {
|
||||||
HFActionEvent endActionEvent(HFActionEvent::endType(), getViewportCenter());
|
// this ends the HFActionEvent
|
||||||
sendEvent(this, &endActionEvent);
|
HFActionEvent endActionEvent(HFActionEvent::endType(), getViewportCenter());
|
||||||
|
sendEvent(this, &endActionEvent);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Qt::Key_Escape: {
|
case Qt::Key_Escape: {
|
||||||
// this ends the HFCancelEvent
|
if (!event->isAutoRepeat()) {
|
||||||
HFBackEvent endBackEvent(HFBackEvent::endType());
|
// this ends the HFCancelEvent
|
||||||
sendEvent(this, &endBackEvent);
|
HFBackEvent endBackEvent(HFBackEvent::endType());
|
||||||
|
sendEvent(this, &endBackEvent);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue