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