mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
Prevent duplicate actions.
This commit is contained in:
parent
edb08572f5
commit
cf3afa8855
1 changed files with 2 additions and 24 deletions
|
@ -2157,11 +2157,6 @@
|
||||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||||
Controller.keyPressEvent.connect(keyPressEvent);
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
|
|
||||||
function deleteKey(value) {
|
|
||||||
if (value === 0) { // on release
|
|
||||||
createApp.deleteSelectedEntities();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function deselectKey(value) {
|
function deselectKey(value) {
|
||||||
if (value === 0) { // on release
|
if (value === 0) { // on release
|
||||||
selectionManager.clearSelections(this);
|
selectionManager.clearSelections(this);
|
||||||
|
@ -3123,11 +3118,6 @@
|
||||||
var isOnMacPlatform = Controller.getValue(Controller.Hardware.Application.PlatformMac);
|
var isOnMacPlatform = Controller.getValue(Controller.Hardware.Application.PlatformMac);
|
||||||
|
|
||||||
var mapping = Controller.newMapping(CONTROLLER_MAPPING_NAME);
|
var mapping = Controller.newMapping(CONTROLLER_MAPPING_NAME);
|
||||||
if (isOnMacPlatform) {
|
|
||||||
mapping.from([Controller.Hardware.Keyboard.Backspace]).to(deleteKey);
|
|
||||||
} else {
|
|
||||||
mapping.from([Controller.Hardware.Keyboard.Delete]).to(deleteKey);
|
|
||||||
}
|
|
||||||
mapping.from([Controller.Hardware.Keyboard.T]).to(toggleKey);
|
mapping.from([Controller.Hardware.Keyboard.T]).to(toggleKey);
|
||||||
mapping.from([Controller.Hardware.Keyboard.F]).to(focusKey);
|
mapping.from([Controller.Hardware.Keyboard.F]).to(focusKey);
|
||||||
mapping.from([Controller.Hardware.Keyboard.J]).to(gridKey);
|
mapping.from([Controller.Hardware.Keyboard.J]).to(gridKey);
|
||||||
|
@ -3138,15 +3128,9 @@
|
||||||
mapping.from([Controller.Hardware.Keyboard["7"]]).to(quickRotate90xKey);
|
mapping.from([Controller.Hardware.Keyboard["7"]]).to(quickRotate90xKey);
|
||||||
mapping.from([Controller.Hardware.Keyboard["8"]]).to(quickRotate90yKey);
|
mapping.from([Controller.Hardware.Keyboard["8"]]).to(quickRotate90yKey);
|
||||||
mapping.from([Controller.Hardware.Keyboard["9"]]).to(quickRotate90zKey);
|
mapping.from([Controller.Hardware.Keyboard["9"]]).to(quickRotate90zKey);
|
||||||
mapping.from([Controller.Hardware.Keyboard.X])
|
|
||||||
.when([Controller.Hardware.Keyboard.Control])
|
|
||||||
.to(whenReleased(function() { selectionManager.cutSelectedEntities() }));
|
|
||||||
mapping.from([Controller.Hardware.Keyboard.C])
|
mapping.from([Controller.Hardware.Keyboard.C])
|
||||||
.when([Controller.Hardware.Keyboard.Control])
|
.when([Controller.Hardware.Keyboard.Control])
|
||||||
.to(whenReleased(function() { selectionManager.copySelectedEntities() }));
|
.to(whenReleased(function() { selectionManager.copySelectedEntities() }));
|
||||||
mapping.from([Controller.Hardware.Keyboard.V])
|
|
||||||
.when([Controller.Hardware.Keyboard.Control])
|
|
||||||
.to(whenReleased(function() { selectionManager.pasteEntities() }));
|
|
||||||
mapping.from([Controller.Hardware.Keyboard.D])
|
mapping.from([Controller.Hardware.Keyboard.D])
|
||||||
.when([Controller.Hardware.Keyboard.Control])
|
.when([Controller.Hardware.Keyboard.Control])
|
||||||
.to(whenReleased(function() { selectionManager.duplicateSelection() }));
|
.to(whenReleased(function() { selectionManager.duplicateSelection() }));
|
||||||
|
@ -3170,10 +3154,8 @@
|
||||||
|
|
||||||
var pressedValue = 0.0;
|
var pressedValue = 0.0;
|
||||||
|
|
||||||
if ((!isOnMacPlatform && keyUpEvent.keyCodeString === "Delete")
|
if (isOnMacPlatform && keyUpEvent.keyCodeString === "Backspace") {
|
||||||
|| (isOnMacPlatform && keyUpEvent.keyCodeString === "Backspace")) {
|
createApp.deleteSelectedEntities();
|
||||||
|
|
||||||
deleteKey(pressedValue);
|
|
||||||
} else if (keyUpEvent.keyCodeString === "T") {
|
} else if (keyUpEvent.keyCodeString === "T") {
|
||||||
toggleKey(pressedValue);
|
toggleKey(pressedValue);
|
||||||
} else if (keyUpEvent.keyCodeString === "F") {
|
} else if (keyUpEvent.keyCodeString === "F") {
|
||||||
|
@ -3194,12 +3176,8 @@
|
||||||
quickRotate90yKey(pressedValue);
|
quickRotate90yKey(pressedValue);
|
||||||
} else if (keyUpEvent.keyCodeString === "9") {
|
} else if (keyUpEvent.keyCodeString === "9") {
|
||||||
quickRotate90zKey(pressedValue);
|
quickRotate90zKey(pressedValue);
|
||||||
} else if (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "X") {
|
|
||||||
selectionManager.cutSelectedEntities();
|
|
||||||
} else if (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "C") {
|
} else if (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "C") {
|
||||||
selectionManager.copySelectedEntities();
|
selectionManager.copySelectedEntities();
|
||||||
} else if (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "V") {
|
|
||||||
selectionManager.pasteEntities();
|
|
||||||
} else if (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "D") {
|
} else if (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "D") {
|
||||||
selectionManager.duplicateSelection();
|
selectionManager.duplicateSelection();
|
||||||
} else if (!isOnMacPlatform && keyUpEvent.controlKey && !keyUpEvent.shiftKey && keyUpEvent.keyCodeString === "Z") {
|
} else if (!isOnMacPlatform && keyUpEvent.controlKey && !keyUpEvent.shiftKey && keyUpEvent.keyCodeString === "Z") {
|
||||||
|
|
Loading…
Reference in a new issue