mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:07:58 +02:00
don't make headMove changes if key is auto repeating
This commit is contained in:
parent
f8b423ced6
commit
8ae1f980f5
1 changed files with 2 additions and 2 deletions
|
@ -142,7 +142,7 @@ function update(deltaTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Controller.keyPressEvent.connect(function(event) {
|
Controller.keyPressEvent.connect(function(event) {
|
||||||
if (event.text == "SPACE" && !movingWithHead) {
|
if (event.text == "SPACE" && !event.isAutoRepeat && !movingWithHead) {
|
||||||
keyDownTime = 0.0;
|
keyDownTime = 0.0;
|
||||||
movingWithHead = true;
|
movingWithHead = true;
|
||||||
headStartPosition = MyAvatar.getTrackedHeadPosition();
|
headStartPosition = MyAvatar.getTrackedHeadPosition();
|
||||||
|
@ -161,7 +161,7 @@ var TIME_FOR_TURN = 0.25;
|
||||||
var TURN_AROUND = 180.0;
|
var TURN_AROUND = 180.0;
|
||||||
|
|
||||||
Controller.keyReleaseEvent.connect(function(event) {
|
Controller.keyReleaseEvent.connect(function(event) {
|
||||||
if (event.text == "SPACE") {
|
if (event.text == "SPACE" && !event.isAutoRepeat) {
|
||||||
movingWithHead = false;
|
movingWithHead = false;
|
||||||
if (keyDownTime < TIME_FOR_TURN_AROUND) {
|
if (keyDownTime < TIME_FOR_TURN_AROUND) {
|
||||||
if (keyDownTime < TIME_FOR_TURN) {
|
if (keyDownTime < TIME_FOR_TURN) {
|
||||||
|
|
Loading…
Reference in a new issue