mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +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();
|
||||
break;
|
||||
case Qt::Key_Space: {
|
||||
// this starts an HFActionEvent
|
||||
HFActionEvent startActionEvent(HFActionEvent::startType(), getViewportCenter());
|
||||
sendEvent(this, &startActionEvent);
|
||||
if (!event->isAutoRepeat()) {
|
||||
// this starts an HFActionEvent
|
||||
HFActionEvent startActionEvent(HFActionEvent::startType(), getViewportCenter());
|
||||
sendEvent(this, &startActionEvent);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case Qt::Key_Escape: {
|
||||
OculusManager::abandonCalibration();
|
||||
|
||||
// this starts the HFCancelEvent
|
||||
HFBackEvent startBackEvent(HFBackEvent::startType());
|
||||
sendEvent(this, &startBackEvent);
|
||||
if (!event->isAutoRepeat()) {
|
||||
// this starts the HFCancelEvent
|
||||
HFBackEvent startBackEvent(HFBackEvent::startType());
|
||||
sendEvent(this, &startBackEvent);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1205,16 +1209,20 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
|
|||
_myAvatar->clearDriveKeys();
|
||||
break;
|
||||
case Qt::Key_Space: {
|
||||
// this ends the HFActionEvent
|
||||
HFActionEvent endActionEvent(HFActionEvent::endType(), getViewportCenter());
|
||||
sendEvent(this, &endActionEvent);
|
||||
if (!event->isAutoRepeat()) {
|
||||
// this ends the HFActionEvent
|
||||
HFActionEvent endActionEvent(HFActionEvent::endType(), getViewportCenter());
|
||||
sendEvent(this, &endActionEvent);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case Qt::Key_Escape: {
|
||||
// this ends the HFCancelEvent
|
||||
HFBackEvent endBackEvent(HFBackEvent::endType());
|
||||
sendEvent(this, &endBackEvent);
|
||||
if (!event->isAutoRepeat()) {
|
||||
// this ends the HFCancelEvent
|
||||
HFBackEvent endBackEvent(HFBackEvent::endType());
|
||||
sendEvent(this, &endBackEvent);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue