For Red Rogue I wanted a fully key operated menu system. This is my proposal for that system. Click on the Flash movie above to focus it.
Press up and down to select an option. To the right will appear sub-menus. Press right to walk into that menu. Press left to return to the menu previous.
When there is no sub-menu to the right, you have reached the end of the descision tree. Press right once more to execute the option you have reached.
And there you have it. A menu system in four keys.
W, A, S, D are alternative controls for the menu that you can redefine by seeking out the "change keys" option.
You can also set up "hot keys". Hot keys by default are Z, X, C, V and B.
Say you want to set up a key to equip a sword or cast a spell. Just walk down the "set hot keys" path. Notice you go back to the main menu. You are now recording a path for that hot key. Walk out to the option you want to bind to that hot key and you will jump back to the main menu. Now try pressing that hot key - you're at the main menu, but look at the event history for the menu in the background. You selected that option without having to walk the menu - the hot key did it for you. Hot keys are accessible during normal play, which means the player can equip items and cast spells at the touch of a button without having to pause and walk the menu.
This system I needed to figure out separately from the game, just so I could get my head around it. Which means the source code is available below (and that's why the Flixel font is used in this demo - the menu is actually calibrated to a purchased font).