History

fix stuck drive keys for Avatar when modifier released

Stephen Birarda committed 12 years ago

Commit de248421 parent 0e4de533 files · +17 −3Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+10−3
@@ -905,7 +905,9 @@ void Application::keyPressEvent(QKeyEvent* event) { · 904 unmodified lines
905 break;905 break;
906 906
907 case Qt::Key_D:907 case Qt::Key_D:
908 _myAvatar->setDriveKeys(ROT_RIGHT, 1.f);908 if (!isMeta) {
909 _myAvatar->setDriveKeys(ROT_RIGHT, 1.f);
910 }
909 break;911 break;
910 912
911 case Qt::Key_Return:913 case Qt::Key_Return:
@@ -1073,7 +1075,7 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 161 unmodified lines
1073 _keysPressed.remove(event->key());1075 _keysPressed.remove(event->key());
1074 1076
1075 _controllerScriptingInterface.emitKeyReleaseEvent(event); // send events to any registered scripts1077 _controllerScriptingInterface.emitKeyReleaseEvent(event); // send events to any registered scripts
1076 1078
1077 // if one of our scripts have asked to capture this event, then stop processing it1079 // if one of our scripts have asked to capture this event, then stop processing it
1078 if (_controllerScriptingInterface.isKeyCaptured(event)) {1080 if (_controllerScriptingInterface.isKeyCaptured(event)) {
1079 return;1081 return;
@@ -1125,7 +1127,12 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 45 unmodified lines
1125 _myAvatar->setDriveKeys(RIGHT, 0.f);1127 _myAvatar->setDriveKeys(RIGHT, 0.f);
1126 _myAvatar->setDriveKeys(ROT_RIGHT, 0.f);1128 _myAvatar->setDriveKeys(ROT_RIGHT, 0.f);
1127 break;1129 break;
1128 1130 case Qt::Key_Control:
1131 case Qt::Key_Shift:
1132 case Qt::Key_Meta:
1133 case Qt::Key_Alt:
1134 _myAvatar->clearDriveKeys();
1135 break;
1129 default:1136 default:
1130 event->ignore();1137 event->ignore();
1131 break;1138 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t