commandKey function in the core files.
I did it because it's easier to use the arrow keys for things like N, S, E, W, (and number keys for commands like "Shoot Assassin 1") than to enter those commands.
Let me know if you're interested, and I'll figure out a way to share a tutorial!
Something like this? http://textadventures.co.uk/forum/quest/topic/3847/how-can-i-impliment-an-image-based-health#25765