Instantly share code, notes, and snippets.

Embed
What would you like to do?

Emulating a Controller with a Keyboard

Introduction

This is recommended for clients that do not have controllers and don't want to inconvenience hosts with allowing keyboard controls, or who want to play games that will not allow multiple players on keyboard.

Installation

On the client computer, get UCR and unzip it, and install Interception to allow for the use of keyboard inputs. UCR requires ViGEm to emulate Xbox 360 controllers, but you will already have it if you installed Parsec with controller support.

Creating a profile

After rebooting, start UCR and select Devices > Manage device groups in the menu. Create an input group and add your keyboard to it from the Core_Interception category.

demonstration of input group setup

Create an output group and add the ViGEm Xbox 360 Controller 1 to it.

demonstration of output group setup

Close the device groups window and select Profile > New in the menu. Give it a name and select your input and output groups.

demonstration of profile creation

Double click your new profile to edit it.

Mapping Inputs

To map a controller button (including the DPad), type a mapping name in the mapping field at the top and click add. then select Button to Button in the plugin dropdown and click add. Click Click to Bind on the left side to select a keyboard input and on the right to select a controller output.

example of mapping a controller button

To map an axis, create one mapping for the positive part of the axis and one for the negative part, and add the Button to Axis plugin on both. Check the invert checkbox on the negative binding and then bind them to their respective keys and both to the same controller axis.

example of mapping a controller axis

To test your mappings, you can select Profile > Activate Profile in the menu and visit the HTML5 Gamepad Tester. You may need to deactivate and activate the profile to apply new changes. When you are done, close the profile window and select File > Save in UCR's main menu. Changes are not automatically saved.

Using the Virtual Controller

You will need to run UCR and activate your profile when you wish to have your virtual controller active.

Troubleshooting

If the ViGEm controllers do not appear as options for output devices, you do not have ViGEm installed. See the "Controller Driver" links at the top of this page.

If your virtual controller is not recognized by the host, they are most likely missing the controller driver; see controller troubleshooting.

You will still be able to use your keyboard normally (unless you block inputs as below), but if you notice extra key presses being added or the mouse being triggered, this is probably caused by Steam controller support. Follow these instructions to disable it.

By default, keyboard inputs are still passed through. It's recommended the host does not give you keyboard access to avoid you pressing whatever buttons you mapped when you use your controller. It is possible to block keyboard inputs with UCR/Interception, but read the instructions and warnings very carefully, because it is possible to create bindings that make it difficult to operate your computer until you deactivate the profile/exit UCR/reboot your computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment