How to get keycode from key event?

Hi, I am wondering how to get the keycode from a key event. I only can get the key display name. Any idea?