Commit d4abe155 authored by Jan Möbius's avatar Jan Möbius
Browse files

Reserved keys for first person moving

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7012 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 75f7fceb
...@@ -936,6 +936,18 @@ public: ...@@ -936,6 +936,18 @@ public:
/// Set Multisampling for active viewer /// Set Multisampling for active viewer
void slotLocalChangeMultisampling(bool _lighting); void slotLocalChangeMultisampling(bool _lighting);
/// When using ego-shooter mode move backward
void moveBack();
/// When using ego-shooter mode move forward
void moveForward();
/// When using ego-shooter mode strafe to the left
void strafeLeft();
/// When using ego-shooter mode strafe to the right
void strafeRight();
private : private :
bool stereoActive_; bool stereoActive_;
......
...@@ -539,6 +539,13 @@ void CoreWidget::registerCoreKeys() { ...@@ -539,6 +539,13 @@ void CoreWidget::registerCoreKeys() {
emit registerKey(Qt::Key_Shift , Qt::ShiftModifier, "Apply context menu action to all Viewers", true); emit registerKey(Qt::Key_Shift , Qt::ShiftModifier, "Apply context menu action to all Viewers", true);
emit registerKey(Qt::Key_Shift , Qt::NoModifier, "Apply context menu action to all Viewers", true); emit registerKey(Qt::Key_Shift , Qt::NoModifier, "Apply context menu action to all Viewers", true);
emit registerKey(Qt::Key_A , Qt::NoModifier, "First Person view strafe left");
emit registerKey(Qt::Key_D , Qt::NoModifier, "First Person view strafe right");
emit registerKey(Qt::Key_W , Qt::NoModifier, "First Person view move forward");
emit registerKey(Qt::Key_S , Qt::NoModifier, "First Person view move back");
} }
/// if a keyPressEvent belongs to the core this functions is called /// if a keyPressEvent belongs to the core this functions is called
...@@ -587,6 +594,7 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){ ...@@ -587,6 +594,7 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
} }
switch (_e->key()) { switch (_e->key()) {
case Qt::Key_Escape: case Qt::Key_Escape:
setActionMode( lastActionMode() ); setActionMode( lastActionMode() );
break; break;
...@@ -598,7 +606,23 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){ ...@@ -598,7 +606,23 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
case Qt::Key_Space: case Qt::Key_Space:
nextViewerLayout(); nextViewerLayout();
break; break;
case Qt::Key_A:
strafeLeft();
break;
case Qt::Key_D:
strafeRight();
break;
case Qt::Key_W:
moveForward();
break;
case Qt::Key_S:
moveBack();
break;
case Qt::Key_Shift : case Qt::Key_Shift :
shiftPressed_ = true; shiftPressed_ = true;
break; break;
......
...@@ -597,4 +597,21 @@ void CoreWidget::slotSetViewingDirection(QAction* _action) { ...@@ -597,4 +597,21 @@ void CoreWidget::slotSetViewingDirection(QAction* _action) {
PluginFunctions::setFixedView( _action->data().toInt() ); PluginFunctions::setFixedView( _action->data().toInt() );
} }
void CoreWidget::moveBack() {
// examiner_widgets_[PluginFunctions::activeExaminer()]->
std::cerr << "move Back" << std::endl;
}
void CoreWidget::moveForward() {
std::cerr << "move Forward" << std::endl;
}
void CoreWidget::strafeLeft() {
std::cerr << "move Left" << std::endl;
}
void CoreWidget::strafeRight() {
std::cerr << "move Right" << std::endl;
}
//============================================================================= //=============================================================================
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment