lets see if I got this right before I respond and look like a dumbass....
You want to have your keyboard I/O send direct output information (base code) to a log file, and then have a function to auto convert that code to english text?
Do you want your I/O to still output the commands (keystrokes) to other places (such as a text document or a password field)? Or do you only want to have the keystroke information sent to this log file?
If you are doing this to be able to decode passwords I would think of easier methods, but for some reason I do not think that is the intention. Well I need a bit of clarity before I can attempt to help. But you could always intentionally download a key logger, modify its base code, and disconnect your PC from the internet (if you use it for secure crap) while doing this, to ensure your keystrokes/private info are not sent to people you don't want them sent to.
If thats not suitable though, just respond to the above and I will see if I can think of something for you. I am not a pro 'drake user, but I think my roomate might be, he is a linux whore.