mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:36:26 +02:00
moving key press detection to JSON
This commit is contained in:
parent
8aedc98a58
commit
07ddd4e1dd
2 changed files with 3 additions and 13 deletions
|
@ -5,6 +5,7 @@
|
||||||
{ "from": "Keyboard.D", "when": ["Keyboard.RightMouseButton", "!Keyboard.Control"], "to": "Actions.LATERAL_RIGHT" },
|
{ "from": "Keyboard.D", "when": ["Keyboard.RightMouseButton", "!Keyboard.Control"], "to": "Actions.LATERAL_RIGHT" },
|
||||||
{ "from": "Keyboard.E", "when": "!Keyboard.Control", "to": "Actions.LATERAL_RIGHT" },
|
{ "from": "Keyboard.E", "when": "!Keyboard.Control", "to": "Actions.LATERAL_RIGHT" },
|
||||||
{ "from": "Keyboard.Q", "when": "!Keyboard.Control", "to": "Actions.LATERAL_LEFT" },
|
{ "from": "Keyboard.Q", "when": "!Keyboard.Control", "to": "Actions.LATERAL_LEFT" },
|
||||||
|
{ "from": "Keyboard.T", "when": "!Keyboard.Control", "to": "Actions.TogglePushToTalk" },
|
||||||
|
|
||||||
{ "comment" : "Mouse turn need to be small continuous increments",
|
{ "comment" : "Mouse turn need to be small continuous increments",
|
||||||
"from": { "makeAxis" : [
|
"from": { "makeAxis" : [
|
||||||
|
|
|
@ -1608,9 +1608,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
switch (actionEnum) {
|
switch (actionEnum) {
|
||||||
case Action::TOGGLE_PUSHTOTALK:
|
case Action::TOGGLE_PUSHTOTALK:
|
||||||
if (state > 0.0f) {
|
if (state > 0.0f) {
|
||||||
audioScriptingInterface->setPushingToTalk(false);
|
|
||||||
} else if (state < 0.0f) {
|
|
||||||
audioScriptingInterface->setPushingToTalk(true);
|
audioScriptingInterface->setPushingToTalk(true);
|
||||||
|
} else if (state <= 0.0f) {
|
||||||
|
audioScriptingInterface->setPushingToTalk(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -4047,7 +4047,6 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
_keysPressed.insert(event->key(), *event);
|
_keysPressed.insert(event->key(), *event);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
|
||||||
_controllerScriptingInterface->emitKeyPressEvent(event); // send events to any registered scripts
|
_controllerScriptingInterface->emitKeyPressEvent(event); // send events to any registered scripts
|
||||||
// if one of our scripts have asked to capture this event, then stop processing it
|
// if one of our scripts have asked to capture this event, then stop processing it
|
||||||
if (_controllerScriptingInterface->isKeyCaptured(event) || isInterstitialMode()) {
|
if (_controllerScriptingInterface->isKeyCaptured(event) || isInterstitialMode()) {
|
||||||
|
@ -4215,10 +4214,6 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_T:
|
|
||||||
audioScriptingInterface->setPushingToTalk(true);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Qt::Key_P: {
|
case Qt::Key_P: {
|
||||||
if (!isShifted && !isMeta && !isOption && !event->isAutoRepeat()) {
|
if (!isShifted && !isMeta && !isOption && !event->isAutoRepeat()) {
|
||||||
AudioInjectorOptions options;
|
AudioInjectorOptions options;
|
||||||
|
@ -4325,12 +4320,6 @@ void Application::keyReleaseEvent(QKeyEvent* event) {
|
||||||
_keyboardMouseDevice->keyReleaseEvent(event);
|
_keyboardMouseDevice->keyReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto audioScriptingInterface = reinterpret_cast<scripting::Audio*>(DependencyManager::get<AudioScriptingInterface>().data());
|
|
||||||
switch (event->key()) {
|
|
||||||
case Qt::Key_T:
|
|
||||||
audioScriptingInterface->setPushingToTalk(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::focusOutEvent(QFocusEvent* event) {
|
void Application::focusOutEvent(QFocusEvent* event) {
|
||||||
|
|
Loading…
Reference in a new issue