@Tricky
Of course, you would need some way of changing the mappings for different games. Maybe the interface would wait for an unusual key combination (maybe all of the F keys simultaneously), at which point it would enter a programming mode. You would then press the keys on the keyboard (in a set order) which you want to map to up/down/left/right/fire.
You could even have software which has presets for different games, so you just select the game you want from a list, and the software simulates pressing all of the F keys to put the interface in to programming mode, then simulates pressing the correct keys for that game. The application should be controllable by the command line so it can be included in a script when launching the game.
--
moto