   }
  }
});
window.addEventListener('keyup', e => {
  if (window.document.pointerLockElement) {
    const gamepads = navigator.getGamepads();

    switch (e.which) {
      case 87: { // W
        keys.up = false;
        break;
      }
      case 83: { // S
        keys.down = false;
        break;
      }
      case 65: { // A
        keys.left = false;
        break;
      }
      case 68: { // D
        keys.right = false;
        break;
      }
      case 69: { // E
        gamepads[1].buttons[2].press