mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 03:32:42 +02:00
inspect.js and mouselook.js compatibility
This commit is contained in:
parent
9d6f08b908
commit
e7277af238
1 changed files with 17 additions and 0 deletions
|
@ -18,6 +18,8 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon)
|
|||
|
||||
var tempOff = false;
|
||||
|
||||
var altMode = false;
|
||||
|
||||
Camera.mouseLookChanged.connect(onMouseLookChanged);
|
||||
|
||||
function onMouseLookChanged(newMouseLook) {
|
||||
|
@ -41,6 +43,21 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon)
|
|||
|
||||
function onKeyPressEvent(event) {
|
||||
if (!hmd){
|
||||
if(event.isAlt){
|
||||
if (keysOnOverlay) return;
|
||||
if (!mouseLookEnabled) return;
|
||||
mouseLookOff();
|
||||
Window.displayAnnouncement("Mouse look: Temporarily OFF");
|
||||
tempOff = true;
|
||||
altMode = true;
|
||||
}
|
||||
if (tempOff && altMode && ['left', 'right', 'up', 'down', 'esc', 'w', 'a', 's', 'd'].includes(event.text.toLowerCase())){
|
||||
if (keysOnOverlay) return;
|
||||
if (!mouseLookEnabled) return;
|
||||
mouseLookOn();
|
||||
tempOff = false;
|
||||
altMode = false
|
||||
}
|
||||
if (event.text === 'm') {
|
||||
if (!keysOnOverlay) {
|
||||
if (mouseLookEnabled) {
|
||||
|
|
Loading…
Reference in a new issue