have spacebar fire an action event at center of screen

This commit is contained in:
Stephen Birarda 2014-10-27 16:54:28 -07:00
parent 209c12cb1c
commit 80d9014726

View file

@ -1102,15 +1102,23 @@ void Application::keyPressEvent(QKeyEvent* event) {
case Qt::Key_Equal:
_myAvatar->resetSize();
break;
case Qt::Key_Space: {
// this starts an HFActionEvent
HFActionEvent startActionEvent(HFActionEvent::startType(), getViewportCenter());
sendEvent(this, &startActionEvent);
break;
}
case Qt::Key_Escape: {
OculusManager::abandonCalibration();
// this fires the HFCancelEvent
// this starts the HFCancelEvent
HFBackEvent startBackEvent(HFBackEvent::startType());
sendEvent(this, &startBackEvent);
break;
}
default:
event->ignore();
break;
@ -1181,6 +1189,13 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
case Qt::Key_Alt:
_myAvatar->clearDriveKeys();
break;
case Qt::Key_Space: {
// 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());