MiSTer Remote Control

I first discovered the amazing MiSTer project via posts by SmokeMonster on RetroRGB and my curiosity got the better of me – I had to have one to play around with.  Racketboy has written an excellent overview and introduction to MiSTer – I recommend you read that to help you decide if the project is for you or not.

Anyway, because I was playing around a lot and experimenting with different joypads I found myself needing to use the keyboard a lot to press F12, Space and Esc.  My small wireless Logitech keyboard was awkward to use for this because I needed to hold FN and another key to get F12 – and my hands weren’t big enough.

I didn’t want a full size keyboard or one of those titchy little ones with tiny keys.  So I searched eBay for a USB wireless remote control and planned to use the info here to setup the remote to meet my needs.

Anyway, I saw some questions in the Newbie thread posted on the MiSTer forums, I thought I’d share on those forms the info that I was preparing to put on here.  I spent so long doing that post, I thought I may as well do a copy and paste!

Here is the Remote

I plugged it in to my MiSTer alongside a full size keyboard, pressed F12 on the full sized keyboard from the main menu and went into the option to remap keys. I pressed each of the buttons on the remote that I wanted to alter and for each button I made a note of which Key it was asking me to remap, then I would press the same button again so in effect I was just mapping it back to itself. I was only interested in remapping the current Standby, Home and Menu keys/buttons.

During this process, you’ll be presented with the Hardware IDs of the keyboard/remote – I made a note of this too. For me the VID was 248a and the PID was 168e. Here is a good guide on finding Hardware IDs that I found before I even tried remapping the keys and realised it displayed the IDs to me.

Be careful of the the Mouse button as that switches modes on the remote, press it again to cancel out of it.

Of course, the Remote doesn’t have an F12 key or a Space Bar, so I used the full size keyboard I had plugged in and just went through the remap fuction for those two keys to get the codes for them.

I switched off and popped the memory card into my PC, for this I was using Windows 10 but you can use whatever you want as long as you can run an Hex Editor on it. I was using the freebie XVI32.

As expected, I found the kbd_XXXX_XXXX.map file in the config folder, where XXXX XXXX matched the ID’s of the Remote displayed when I was remapping the keys/buttons.

Next up was to open the file up in my Hex Editor and start editing it to behave how I wanted.

So, from my own notes I scribbled – the key codes I was concerned with were as follows.

F12 – 58
Menu = 7F
Space bar = 39
Standby = 8E
Home = AC

Because I had messed around remapping the Standby, Home and Menu keys already, they had codes in the corresponding place in the file already. IF you’ve pressed some other keys and want to reset them back to default, simply overtype the code with two Zeros to remove the mapping completely.

In the following screenshots, ignore the right hand side where you’ll see ASCII letters/characters, we are only concerned with the Hex codes on the left.

So, for the Standby button, I found the corresponding space in the file and overtyped the entry with the code for F12 which is 58

How did I know it was the right place in the file to type into? Well I forgot to get a screenshot first, but it was showing the code for Standby which was 8E, so look for 8E and replace it with 58. Or, if you check the bottom left corner of the screenshot (I left the mouse pointer at it) out you’ll spy that it shows the Hex Address which is 8E, which we know is the code for Standby key.

I then repeated this for the Home button to also use as F12 (current code AC, new code is 58 again).

And finally for the Menu button as the Space bar (current code 7F, new code 39)

Then I saved the file, popped it back into my DE10-Nano and much to my surprise – it worked :-)  I didn’t expect to get it right first time!

You will be able to find my keyboard map file in the downloads link, but of course that relies on your remote having the same IDs as mine with the same buttons on, if it doesn’t though, the information above should be enough to get you started on creating your own keyboard map file.