How to Make a Keyboard Function as an Xbox Controller

I recently showed a friend my modded Arcade 1Up machine, and he loved it so much he decided he wanted an arcade machine of his own. Unfortunately, he didn’t ask my opinion about what to buy, he just blindly bought a full-sized 4 player arcade machine from some random company online. The worst part was how much he paid for it. I’ll just kindly say he paid way more than it was worth.

When he fired it up, he complained that there was nothing but “old” games in the cabinet and he also noted that it ran a bit laggy. I opened up the machine and it was a low quality all-in-one motherboard that sells for $40 on random Chinese discount sites. He wanted to be able to play modern games on Windows 10 and I had to break the bad news to him. I told him I would have to pretty much gut the cabinet and replace everything.

A few weeks later, I ordered all of the parts I needed and installed everything. He wanted to be able to emulate any console and run any game, so I installed a high-end gaming rig to keep everything future proof. He also wanted color-changing LED buttons, so I ordered all of the necessary parts required for that. The machine had 9TB of storage and every emulator ran great. I began to run into some obstacles when he asked me to start setting up PC games.

The controller board I used to wire up all 4 players was something that was required to get the color-changing LED lights to work, which was an “IPAC Ultimate I/O“. It’s priced at around $100, but it has some very awesome features. It can map all 4 players to a single board and you can map RGB lights to each and every button. Here is some footage of the cabinet emulating “Loco Roco”, with all of the buttons lighting up along with it.

Loco Roco running on a PSP Emulator. Arcade has color changing buttons and a custom 1920×360 LCD panel up top to display dynamic marquee artwork.

The IPAC Ultimate board has the ability to behave as a keyboard for 4 players or as x-input (aka Xbox) controllers. However, if you choose to configure the board to act as x-input, it will only work as 2 controllers. Since I was using a 4 player cabinet, I had no choice but to go with the keyboard input option. Having keyboard input also has better support for a wider range of emulators as well. I needed to be able to play every modern PC game though, and many of them required Xbox controllers.

PC games like Cuphead play great with the keyboard to
x-input driver.

The Perfect Solution

I was really beginning to scratch my head at this problem. I found countless programs that turned Xbox controller buttons to map as keyboard keys, but I surprisingly didn’t find many options to do the opposite. I needed keyboard keys to act as Xbox controller buttons. When I did find solutions online, people on various forums were talking about installing multiple programs and using very complicated configuration steps. I could never get those methods to function right, so I kept searching for something more user-friendly. That’s when I found an awesome app called “Xarcade-Xinput“.

This app takes a much more cleaner approach. You simply just install the driver and launch the app and your keyboard will suddenly think it is an Xbox controller. If you go into your controller device settings, you will suddenly see that there are Xbox controllers plugged in. The only hurdle I ran into was mapping the buttons. It was intended for the X-Arcade line of arcade sticks. If you have one of those, you are ready to go. For my situation though, it was a bit more complicated.

I already had keyboard keys configured specifically for each and every emulator, so I had a very different button layout than the X-arcade. The button layout was also configured for only 2 controllers and not 4, so I had to address that as well. Luckily, I made a spreadsheet to easily see every key and every button assignment that the arcade machine used. I would highly suggest doing the same thing, because things will get really confusing otherwise.

The other complicated thing was the “syntax” that the controller layout file uses. You can simply edit the layout file in Notepad, but here is what my layout file looks like after I customized it for 4 players.

{
    "H": [0, "A"],
    "Y": [0, "B"],
    "B": [0, "X"],
    "Z": [0, "Y"],

    "D1": [0, "Start"],
    "D5": [0, "Back"],

    "Up": [0, "LeftStickY"],
    "Down": [0, "LeftStickY", -1],
    "Left": [0, "LeftStickX", -1],
    "Right": [0, "LeftStickX"],

    "X": [0, "LeftTrigger"],
    "N": [0, "RightTrigger"],

    "A": [1, "A"],
    "S": [1, "B"],
    "W": [1, "X"],
    "I": [1, "Y"],

    "D2": [1, "Start"],
    "D6": [1, "Back"],
    
    "R": [1, "LeftStickY"],
    "F": [1, "LeftStickY", -1],
    "D": [1, "LeftStickX", -1],
    "G": [1, "LeftStickX"],

    "K": [1, "LeftTrigger"],
    "C": [1, "RightTrigger"],    
    "J": [2, "A"],
    
    "T": [2, "B"],
    "E": [2, "X"],
    "LControlKey": [2, "Y"],

    "D3": [2, "Start"],
    "D7": [2, "Back"],
    

    "V": [2, "LeftStickY"],
    "O": [2, "LeftStickY", -1],
    "U": [2, "LeftStickX", -1],
    "M": [2, "LeftStickX"],    
    
    "OemOpenBrackets": [3, "A"],
    "Oem6": [3, "B"],
    "Space": [3, "X"],
    "Oem1": [3, "Y"],

    "D4": [3, "Start"],
    "D8": [3, "Back"],
    

    "L": [3, "LeftStickY"],
    "OemPeriod": [3, "LeftStickY", -1],
    "OemQuestion": [3, "LeftStickX", -1],
    "Oemcomma": [3, "LeftStickX"]
}

So each assignment is broken down like this:

“KEYBOARD KEY” : [PLAYER#, “XBOXBUTTON”],

“Player 1” is 0, “Player 2” is 1, “Player 3” is 2, and “Player 4” is 3. It’s possible that you can map more than 4 players, but I didn’t test that. The more challenging part when configuring the controls was getting the syntax just right. For example, the “1” key is “D1”. Some assignments are even more confusing, such as the “/” forward-slash key being “OemQuestion”. Here is an image of my entire button configuration that should be helpful with figuring out how to map everything:

From left to right: IPAC Ultimate board pins, keyboard key assignment to the board, Xbox controller assignment, shift keys, and proper syntax to assign keys in xarcade-xinput.

Of course, the image above is specific to my layout, but if you are trying to figure out how to label certain keys, that should help you figure out what to name your keys when configuring your controls.

Once you think you have everything assigned correctly, go here to easily test the input of your game controllers on your PC. https://html5gamepad.com/

I wish I found that site a long time ago, it’s really useful for detecting what controllers you have connected and you can easily test each and every input on all 4 controllers from a single screen. You can still test your controllers from within Windows, but using that site makes things much more convenient.

One last thing that I did, was I created an AutoHotKey script to exit the app automatically. I am using LaunchBox with this arcade cabinet, so you can assign applications to launch with each game. So I created a .bat file to launch the Xbox controller driver app and I also make it launch the AutoHotKey script so that everything closes all at once when I press the escape key. Makes things perfectly automated for when you want to jump out of a Windows game and into MAME without having to manually close or open external apps.

The AutoHotKey script I made looks like this:

$Esc::
{
Process, Close, XArcade_XInput.exe
}

Escape::
Send !{f4}

if WinExist("LaunchBox Game Startup")
{
WinActivate
WinWaitClose, LaunchBox Game Startup
}

if WinExist("LaunchBox")
{
WinActivate
}

if WinExist("LaunchBox Big Box")
{
WinActivate
}

ExitApp
return

That script simply closes the Xarcade-Xinput app and the Windows game at the same time when you press the “Escape” key. Thanks to some feedback in the comments below, I also added a “WinActivate” argument that makes sure Big Box or LaunchBox maintains focus after exiting a game.

I then converted that script into an .exe file and named it “auto_close_xinput.exe”. To make the Xarcade-Xinput app and the script launch at the same time, I created a .bat file with this code:

@echo off

   start auto_close_xinput.exe
   start XArcade_XInput.exe --skip-ui
   
@echo on

Once those are made, you can add those to your Windows games in LaunchBox. You can play controller-only games like “Overcooked” with 4 players without any fuss.

Hopefully these instructions weren’t too complicated (or too dumbed down). There are so many different levels of experience that come to visit this site, it can be challenging to cut to the chase without losing someone. If you have any questions or get things to work great, I’d love to hear your feedback! I’m also open to suggestions to make things easier. I am definitely not claiming to be a “pro” at this.

Edward Hyman

Besides gaming, I'm really into technology in general.