ener('keypress', e => {
  if (!window.document.pointerLockElement) {
    if (focusedTab) {
      /* if (focusedTab === rig.menuMesh.urlMesh) {
        rig.menuMesh.urlMesh.handleKey(e.keyCode, e.shiftKey);
      } else */if (focusedTab.iframe) {
        focusedTab.iframe.sendKeyPress(e.which, {
          shiftKey: e.shiftKey,
          ctrlKey: e.ctrlKey,
          altKey: e.altKey,
        });
      }
    }
  }
});

// let renderTarget = null;
const startTime = Date.now();
let lastTime = 0;
function animat