Reconfigure Arrow Keys In Code

Published 2023-06-12


(v02 11-16-22)
TO LOAD THIS PICO-8 CART, in immediate mode, type:
load #reconfig_arrow_keys

VVhat's New ?

Use the arrow keys to navigate and press 🅾️ to reconfigure the arrow keys to anything you like.

Hello.

One thing I noticed about new Pico-8 is that KeyConfig() no longer works inside code. Now this is not something recent. I think it was years ago that it =DID= work, however.

So as coders we must find a workaround. Here now is one I have written to examine full of many remarks and comments explaining what is going on. Not only does it let you choose SHIFT and other non-standard keys for your arrows, it also records them so even if you shut it down and bring it back up later it remembers what you recorded.

What keys should you choose ? Well of course there is the classic arrow keys. But how about W A S D or I J K M. In Ultima 1 for the Apple ][ computer it was the the ,.ENTER and / keys to move West, East, North, and South.

If you want to see a raw key viewer which will show you the numeric value for every single key on your keyboard, I wrote a tool for that you can find HERE:

https://www.lexaloffle.com/bbs/?pid=117149

Just for fun, here is the Shrinko-8'ed version of the reconfigure cart. :)

HOPE THIS HELPS !