code: function addWindowEventListeners() {
              if(window.onMouseDown){
                  mouse.addEventListener(MouseEvent.MOUSE_DOWN, window.onMouseDown.bind(window));
              }
              if(window.onMouseUp){
                  mouse.addEventListener(MouseEvent.MOUSE_UP, window.onMouseUp.bind(window));
              }
              if(window.onMouseMove){
                  mouse.addEventListener(MouseEvent.MOUSE_MOVE, window.onMouseMove.bind(window));
              }
              if(window.onMouseDrag){
                  mouse.addEventListener(MouseEvent.MOUSE_DRAG, window.onMouseDrag.bind(window));
              }
              if(window.onMouseScroll){
                  mouse.addEventListener(MouseEvent.MOUSE_SCROLL, window.onMouseScroll.bind(window));
              }
  
  
              if(window.onKeyDown){
                  keyboard.addEventListener(KeyboardEvent.KEY_DOWN, window.onKeyDown.bind(window));
              }
              if(window.onKeyPress){
                  keyboard.addEventListener(KeyboardEvent.KEY_PRESS, window.onKeyPress.bind(window));
              }
              if(window.onKeyUp){
                  keyboard.addEventListener(KeyboardEvent.KEY_UP, window.onKeyUp.bind(window));
              }
              if(window.onWindowResize) {
                  window.addEventListener(WindowEvent.WINDOW_RESIZE, window.onWindowResize.bind(window));
              }
          }
docs: Wait with adding event listeners until the app initializes This allow a GUI or an Arcball controller to get priority over e.g. onMouseDown