Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onKeyPress = ({ event }) => {
switch (event.key) {
case "q": // Q
this.transform.setSpace(this.transform.space === "local" ? "world" : "local");
break;
case "ctrl": // Ctrl
this.transform.setTranslationSnap(100);
this.transform.setRotationSnap(THREE.Math.degToRad(15));
break;
case "w": // W
this.transform.setMode("translate");
break;
case "e": // E
this.transform.setMode("rotate");
break;
case "r": // R
this.transform.setMode("scale");
break;
case 187:
case 107: // +, =, num+
this.transform.setSize(this.transform.size + 0.1);
break;
case 189:
case 109: // -, _, num-