CorpWar Keycast are a java open-source keystroke visualizer that display what buttons you are pressing. This can be very good when you want to display your keystroke while recording screencasts. I hope this work for all OS but I have problem to test it. So if someone want to test it on other then Windows I would be happy.
You can download the latest version here.
You can find the source code for this on GitHub here.