I've been playing with different joypads on my MiSTer and pressing F12 is sometimes awkward. Not all of them have lots of buttons, some are USB SNES pads with minimum buttons for example.
I didn't want to always have a keyboard plugged in, and my small wireless keyboard needed me to hold FN and press F12 which was annoying, so I searched eBay for USB Remote Control and bought a cheap one from China to play around for fun after reading here about remapping keys on a keyboard
It works pretty well! Using the Keyboard Remap feature from the Main Menu and playing around with a hex editor I was able to get the remote to function as I wanted (which was mainly being able to press F12 and Space which I couldn't always do due to swapping joy pads over and so on).
I realise that this may seem pointless to some, but there maybe someone else out there who wants to do the same thing.
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
I found the kbd_XXXX_XXXX.map file in the config folder, where XXXX XXXX matched the ID's of the Remote when I was remapping the keys/buttons.
I opened it up in my Hex Editor and starting editing it to behave how I wanted.
So, from my notes 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 Many 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)
I saved the file, popped it back into my DE10-Nano and much to my surprise - it worked
Here's the file in case you wanted it
, but of course that relies on your remote having the same IDs as mine with the same buttons on.