# Mouse and Keyboard Input in VR Template Project. (4.27)

**URL:** <https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824>\
**Category:** XR Development\
**Tags:** unreal-engine\
**Created:** [January 25, 2022, 3:32pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824 "2022-01-25T15:32:47Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaron1a12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aaron1a12](https://forums.unrealengine.com/u/aaron1a12)\
**Post date:** [January 25, 2022, 3:32pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/1 "2022-01-25T15:32:48Z")

</div>

Does anybody have any idea why COMMON gameplay inputs like WASD and spacebar do not work in any VR project? IS THIS A BUG?

To reproduce:

-Put the FPS blueprint pawn and add an event handler for “Any Key” and maybe tie it to a print node.

The following keys are bizarrely blocked: QWERASDF and SPACE.

I’m using OpenXR in UE4.27.

---

<div class="post-metadata">

**Author:** ![aaron1a12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aaron1a12](https://forums.unrealengine.com/u/aaron1a12)\
**Post date:** [January 25, 2022, 3:57pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/2 "2022-01-25T15:57:19Z")

</div>

OK. I bashed my head in yesterday trying to fix this and finally found it out, just after posting here.

IT’S THE BP\_VRSpectator! It’s consumes the input and therefore, does not pass it down to my pawn.

---

<div class="post-metadata">

**Author:** ![HAF-Blade](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/haf-blade/32/88718_2.png) [@HAF-Blade](https://forums.unrealengine.com/u/HAF-Blade)\
**Post date:** [January 25, 2022, 4:31pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/3 "2022-01-25T16:31:13Z")

</div>

I would never want to play a game with vr and mouse and keyboard.

---

<div class="post-metadata">

**Author:** ![aaron1a12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aaron1a12](https://forums.unrealengine.com/u/aaron1a12)\
**Post date:** [January 25, 2022, 4:47pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/4 "2022-01-25T16:47:53Z")

</div>

It’s not for gameplay. During development, it’s extremely useful to get a third-person view of the VR pawn.

Also, VR headsets are not always available, and putting the headset on and off all the time can get quite bothersome.

---

<div class="post-metadata">

**Author:** ![joaulo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joaulo/32/464778_2.png) [@joaulo](https://forums.unrealengine.com/u/joaulo)\
**Post date:** [January 26, 2022, 2:00pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/5 "2022-01-26T14:00:04Z")

</div>

Hi, I have the same need, I would like to be able to use the mouse to turn the view when I’m in Play in Editor.  
Were you able to do it?

---

<div class="post-metadata">

**Author:** ![aaron1a12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aaron1a12](https://forums.unrealengine.com/u/aaron1a12)\
**Post date:** [January 26, 2022, 2:17pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/6 "2022-01-26T14:17:22Z")

</div>

Yes. In the VR template that comes with UE4.27 (maybe older versions too), there is a VR spectator pawn. Simply press Tab to activate it.

---

<div class="post-metadata">

**Author:** ![joaulo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joaulo/32/464778_2.png) [@joaulo](https://forums.unrealengine.com/u/joaulo)\
**Post date:** [January 26, 2022, 2:51pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/7 "2022-01-26T14:51:30Z")

</div>

Oh I see… thank you, unfortunately this is not what I’m looking for.  
I need “look around” when I play in editor to test and debug, but I need to use Player Pawn, I wonder if it’s possible.

---

<div class="post-metadata">

**Author:** ![aaron1a12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aaron1a12](https://forums.unrealengine.com/u/aaron1a12)\
**Post date:** [January 26, 2022, 3:17pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/8 "2022-01-26T15:17:20Z")

</div>

Everything is possible if you’re willing to code it. You might have to create your own pawn and edit the “Default Pawn Class” in GameMode to spawn it instead of the VR pawn. You can even get fancy and set it to None and then manually spawn either depending on whether you have an HMD connected.

---

<div class="post-metadata">

**Author:** ![VictorLerp](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/victorlerp/32/738381_2.png) [@VictorLerp](https://forums.unrealengine.com/u/VictorLerp)\
**Post date:** [January 26, 2022, 3:30pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/9 "2022-01-26T15:30:09Z")

</div>

VRSpectator was added in 4.27. Previous versions doesn’t have it by default, but all of the functionality to build it exists.

---

<div class="post-metadata">

**Author:** ![joaulo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joaulo/32/464778_2.png) [@joaulo](https://forums.unrealengine.com/u/joaulo)\
**Post date:** [January 26, 2022, 3:36pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/10 "2022-01-26T15:36:41Z")

</div>

Actually I’m using a VRPawn on HMD and a FPSPawn in Editor, handled with 2 different Game Modes. It works but there are two main downsides:

1. you have to switch GM Override to the right one before testing a level, and sometimes I forgot to set the right one passing to a different level… nothing serious, but the lost times accumulate.
2. VR and FPS Pawns have almost same buleprints nodes, so each time I fix an error or modify something, I have to replicate it in the other as well… this way the risk of making oversights or errors is high, it is not the best to have duplicates.

This is why I’d prefer to have only one pawn working on HMD and in editor.

---

<div class="post-metadata">

**Author:** ![VictorLerp](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/victorlerp/32/738381_2.png) [@VictorLerp](https://forums.unrealengine.com/u/VictorLerp)\
**Post date:** [January 26, 2022, 4:15pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/11 "2022-01-26T16:15:58Z")

</div>

I’m experimenting with a solution for a mouse and keyboard “DebugPawn” that’s clean enough to be included in the template by default. It’s using Enhanced Input but earliest timeframe for this would be 5.1.

---

<div class="post-metadata">

**Author:** ![VictorLerp](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/victorlerp/32/738381_2.png) [@VictorLerp](https://forums.unrealengine.com/u/VictorLerp)\
**Post date:** [January 26, 2022, 4:18pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/12 "2022-01-26T16:18:40Z")

</div>

There’s also the Windows Mixed Reality Input simulator but I haven’t tried it with OpenXR: [Using the Windows Mixed Reality simulator - Mixed Reality | Microsoft Docs](https://docs.microsoft.com/en-us/windows/mixed-reality/develop/advanced-concepts/using-the-windows-mixed-reality-simulator)

---

<div class="post-metadata">

**Author:** ![joaulo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joaulo/32/464778_2.png) [@joaulo](https://forums.unrealengine.com/u/joaulo)\
**Post date:** [January 26, 2022, 4:19pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/13 "2022-01-26T16:19:02Z")

</div>

Glad to see it’s on the way! I’ll wait for it and in the meanwhile I suppose that I should get the work done with my temporary solution.  
Thank You!

---

<div class="post-metadata">

**Author:** ![aaron1a12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aaron1a12](https://forums.unrealengine.com/u/aaron1a12)\
**Post date:** [January 26, 2022, 4:23pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/14 "2022-01-26T16:23:22Z")

</div>

Hi, I heard that OpenXR is no longer beta and is production-ready, however, the ResetOrientationAndPosition() method is a dummy function and does nothing. I think this is a red alert and should be fixed immediately. Here’s the code in OpenXRHMD.cpp:

```auto
void FOpenXRHMD::ResetOrientation(float Yaw)
{
}

void FOpenXRHMD::ResetPosition()
{
}

```

---

<div class="post-metadata">

**Author:** ![joaulo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joaulo/32/464778_2.png) [@joaulo](https://forums.unrealengine.com/u/joaulo)\
**Post date:** [January 26, 2022, 4:24pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/15 "2022-01-26T16:24:01Z")

</div>

I’m using Linux as much as possible so… 😅

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8fba4b7e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8fba4b7e](https://forums.unrealengine.com/u/anonymous_user_8fba4b7e)\
**Post date:** [September 3, 2022, 9:50pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/16 "2022-09-03T21:50:38Z")

</div>

Is anybody found solution. I’m also want a solution for virtual reality template my project. I need to add keyboard input with my unreal game (5.0.3 version) .  
It works when i connect quest 2 through vr preview. But after i packaged to quest 2 it does not work .

Thanks for advance

---

<div class="post-metadata">

**Author:** ![chloehurrell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chloehurrell/32/88707_2.png) [@chloehurrell](https://forums.unrealengine.com/u/chloehurrell)\
**Post date:** [March 13, 2023, 11:10pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/17 "2023-03-13T23:10:54Z")

</div>

How did you get it to work in VR preview? I am doing my phd and comparing the effectiveness of VR vs desktop, so I have 2 levels in a third person game where in one ive changed the third person to a VR pawn, but when I try to move I cant. How do I fix this??

---

<div class="post-metadata">

**Author:** ![MrFr3Man](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrFr3Man](https://forums.unrealengine.com/u/MrFr3Man)\
**Post date:** [May 10, 2025, 1:50pm UTC](https://forums.unrealengine.com/t/mouse-and-keyboard-input-in-vr-template-project-4-27/274824/18 "2025-05-10T13:50:24Z")

</div>

Thanks so mush!!!
