Note: this cart was mostly based on New Raw Key Reader, from dw817.
This is a very simple tool to show scancodes (and SDL key names) for keys pressed on a keyboard.
This can be useful when remapping handheld buttons. For example, I have an original RG35XX and I'm using the MyMinUI custom firmare. I wasn't satisfied with the default button mappings, so I decided to remap everything from scratch.
First, I commented the map_scancodes
line in config.txt and ran this cart.
- The A button was mapped to scancode 44 (spacebar).
- The B button was mapped to scancode 224 (left ctrl).
- I wanted to remap them to scancodes 29 (the Z key) and 27 (the X key), respectively.
If these were the only two buttons I wanted to remap, I could simply add the line below to my config.txt:
map_scancodes 44=29,224=27 |
MyMinUI actually already remaps the A and B buttons the way I wanted. In the real scenario, I did this to remap other buttons (SELECT and POWER).
But explaining Z and X keys is easier to digest, as these bindings are engraved in our brains after playing so much PICO-8 on our keyboards.
Anyway, I hope this cart is useful to someone...
SDL names
SDL names were taken from
https://fossies.org/linux/SDL2/include/SDL_scancode.h
Changelog
- v1.1: improves the draw function to display up to 14 keys pressed at once
- v1.0: initial version
[Please log in to post a comment]