Input handling via lua is really a great idea! I love how easy it is to modify!
One question though: Is there an easy way to determine screen orientation, e.g. for programming the four-way button?
Distinguishing between portrait and landscape should be easy enough with client_height and client_width, but one still does not know "which" landscape: keys on the left or on the right.