Difference between revisions of "Keyboard and Mouse Input For Games"

From EmuVR Wiki
Jump to: navigation, search
(Created page with "This is an advanced topic. Some games or systems have mouse and/or keyboard support. To learn how to enable that kind of input for games in EmuVR, read Installation_Guide#C...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This is an advanced topic.
 
This is an advanced topic.
  
Some games or systems have mouse and/or keyboard support. To learn how to enable that kind of input for games in EmuVR, read [[Installation_Guide#Core_Options_.28Advanced.29|Core Options]].
+
Some games or systems have mouse and/or keyboard support. To learn '''how to enable''' that kind of input for games in EmuVR, read [[Installation_Guide#Core_Options_.28Advanced.29|Core Options]].
  
 
'''You need to use your actual real life keyboard and mouse for this.'''
 
'''You need to use your actual real life keyboard and mouse for this.'''
 
Some cores will also need you to change specific settings in Retroarch.
 
  
 
== Mouse Input ==
 
== Mouse Input ==
When mouse input is enabled, if you're controlling a game, you will move the ingame mouse cursor. In desktop mode, your mouse won't move the camera when controlling games with mouse input.
+
When mouse input is enabled for a game, if it has [[Controls#focus_input|Input Focus]], you will move the ingame mouse cursor. In desktop mode, your mouse won't move the camera when controlling games with mouse input.
  
When you [[Controls#focus_input|focus input]] to a mouse-enabled game, EmuVR will automatically lock your cursor as if pressing the [[Controls#lock_mouse|Lock Mouse]] key.
+
When you [[Controls#focus_input|start controlling]] a mouse-enabled game, EmuVR will automatically lock your cursor as if pressing the [[Controls#lock_mouse|Lock Mouse]] key.
  
 
== Keyboard Input ==
 
== Keyboard Input ==
Line 17: Line 15:
 
That's why Retroarch has a mode called "Game Focus", where it simply will disable all hotkeys, so you can use your keyboard at will.
 
That's why Retroarch has a mode called "Game Focus", where it simply will disable all hotkeys, so you can use your keyboard at will.
  
'''When enabling keyboard input mode for a system in the Game Scanner, your games will run in Retroarch with Game Focus enabled automatically from start.'''
+
'''When enabling keyboard input mode for a system in Game Scanner, your games will run in Retroarch with Game Focus enabled automatically from start.'''
  
That means that if you do want to use a hotkey temporarily, for example to show Retroarch's menu or to change the volume, you'll need to toggle "Game Focus" mode by pressing '''Scroll Lock'''. Press it again to disable all hotkeys back after you're done, or you might be pressing random hotkeys accidentally.
+
That means that if you do want to use a hotkey temporarily, for example to show Retroarch's menu or to change the volume, you'll need to '''turn off''' "Game Focus" mode ''(which enables your hotkeys back)'' by pressing '''Scroll Lock'''. Press '''Scroll Lock''' again after you're done, to disable all hotkeys again, or you might be pressing random hotkeys accidentally.
  
 
'''TL;DR:'''
 
'''TL;DR:'''
 
* All keyboard hotkeys are disabled in keyboard mode, so that you can type.
 
* All keyboard hotkeys are disabled in keyboard mode, so that you can type.
 
* Press '''Scroll Lock''' to toggle them back if you need them.
 
* Press '''Scroll Lock''' to toggle them back if you need them.
* Don't forget to toggle them again before you play.
+
* Don't forget to toggle them again before you resume playing.
  
Gamepad input is unaffected by this, it will always work. Some systems can receive input from both a keyboard and a gamepad at the same time.
+
Gamepad buttons are not affected by this, they will always work. Some systems can receive input from both a keyboard and a gamepad at the same time.
  
 
== EmuVR Window Focus ==
 
== EmuVR Window Focus ==
When you [[Controls#focus_input|focus input]] to a mouse or keyboard enabled game, EmuVR will automatically activate and bring its window to the foreground.
+
When you [[Controls#focus_input|focus input]] to a mouse or keyboard enabled game, EmuVR will automatically bring its window to the foreground.
 
+
If you alt-tab from EmuVR or other window/program receive focus, it will automatically [[Controls#unfocus_input|unfocus you from the game]]. It is designed like this to prevent you from accidentally clicking or pressing keys randomly on other windows in your desktop unknowingly, in case another program steals focus for some reason and you didn't realize it because you're using an HMD.
+
 
+
== Retroarch Settings / Core Options (Extra Advanced) ==
+
'''Some systems/cores will need extra steps to enable keyboard or mouse input in Retroarch.'''
+
 
+
For example, to play Mario Paint on the SNES, you'll need to change your '''User 1 Device Type''' from '''Retropad''' to '''Mouse'''.
+
 
+
To play The Typing of the Dead on Dreamcast, you'll need to change your '''User 1 Device Type''' from '''Retropad''' to '''Keyboard'''.
+
 
+
Some other cores might need more exotic settings to learn.
+
  
And you'll need to save your settings, usually as a game override, because you won't want all your SNES games to use the mouse, which disables gamepad input (for SNES), and that's what would happen if you save that in your global Retroarch settings. ''This complication might be improved upon in the future.''
+
If you alt-tab from EmuVR, or any other window/program suddenly gets focused, EmuVR will automatically [[Controls#unfocus_input|unfocus your input]] from the controlled game. It's designed like this to prevent you from accidentally clicking or pressing keys randomly onto other windows in your desktop unknowingly, in case another program steals focus for some reason and you didn't realize it because you're in VR.
  
To learn how Retroarch overriders work, read this: https://docs.libretro.com/guides/overrides/
+
== Core Options / Device Code ==
To learn about specific core options, check the Libretro docs for your core. Example: https://docs.libretro.com/library/snes9x_2010/#user-1-device-types
+
You'll notice there's a "Device code" drop-down in the Core Options window with a number. That number is the ID that defines which virtual controller that core will simulate, such as a gamepad, light gun, mouse, keyboard, or even a single ID for a mouse + keyboard combo. Each core can have its own different ID numbers to define which is which.
  
 +
'''Game Scanner has an internal database with proper values for each core.''' When you click to enable "Mouse" and/or "Keyboard" input, it will automatically select the default device ID for you.
  
For most systems that usually come bundled with a keyboard and/or mouse, you probably won't need to change any special settings for them to work. '''Example: DOS and Commodore 64 will just work with your mouse/keyboard with default settings.'''
+
All the games under that folder will automatically use the chosen input device in Retroarch, which means you don't need to mess with Retroarch's input settings to save core overrides or remaps manually.

Latest revision as of 23:57, 11 April 2021

This is an advanced topic.

Some games or systems have mouse and/or keyboard support. To learn how to enable that kind of input for games in EmuVR, read Core Options.

You need to use your actual real life keyboard and mouse for this.

Mouse Input

When mouse input is enabled for a game, if it has Input Focus, you will move the ingame mouse cursor. In desktop mode, your mouse won't move the camera when controlling games with mouse input.

When you start controlling a mouse-enabled game, EmuVR will automatically lock your cursor as if pressing the Lock Mouse key.

Keyboard Input

Retroarch has a lot of hotkeys for your keyboard, like pressing P to pause a game, F1 to show the menu, Esc to exit the game, numpad + or - to change the volume, etc. If you're trying to use your keyboard to play games or write code in your Commodore 64, for example, those hotkeys will get in the way.

That's why Retroarch has a mode called "Game Focus", where it simply will disable all hotkeys, so you can use your keyboard at will.

When enabling keyboard input mode for a system in Game Scanner, your games will run in Retroarch with Game Focus enabled automatically from start.

That means that if you do want to use a hotkey temporarily, for example to show Retroarch's menu or to change the volume, you'll need to turn off "Game Focus" mode (which enables your hotkeys back) by pressing Scroll Lock. Press Scroll Lock again after you're done, to disable all hotkeys again, or you might be pressing random hotkeys accidentally.

TL;DR:

  • All keyboard hotkeys are disabled in keyboard mode, so that you can type.
  • Press Scroll Lock to toggle them back if you need them.
  • Don't forget to toggle them again before you resume playing.

Gamepad buttons are not affected by this, they will always work. Some systems can receive input from both a keyboard and a gamepad at the same time.

EmuVR Window Focus

When you focus input to a mouse or keyboard enabled game, EmuVR will automatically bring its window to the foreground.

If you alt-tab from EmuVR, or any other window/program suddenly gets focused, EmuVR will automatically unfocus your input from the controlled game. It's designed like this to prevent you from accidentally clicking or pressing keys randomly onto other windows in your desktop unknowingly, in case another program steals focus for some reason and you didn't realize it because you're in VR.

Core Options / Device Code

You'll notice there's a "Device code" drop-down in the Core Options window with a number. That number is the ID that defines which virtual controller that core will simulate, such as a gamepad, light gun, mouse, keyboard, or even a single ID for a mouse + keyboard combo. Each core can have its own different ID numbers to define which is which.

Game Scanner has an internal database with proper values for each core. When you click to enable "Mouse" and/or "Keyboard" input, it will automatically select the default device ID for you.

All the games under that folder will automatically use the chosen input device in Retroarch, which means you don't need to mess with Retroarch's input settings to save core overrides or remaps manually.