If you want to know what key produces what code, su and run showkey. Every time you press or release a key, it will tell you exactly what scancode is produced.