keyboard-fw: change the menu display system to a state machine
The menu display system was previously a state machine in several variables; this change transitions it (pun) to a state machine with a single state variable, four well-defined states, and two ancillary data variables (unchanged).