Ubuntu – Getting character key code mappings in Ubuntu

keyboardxorgxserver

I am trying to play around with some keyboard layouts in Ubuntu. Now there is a program called showkey which lets me see the keycode for any key pressed in the terminal.
Is there any command to get the corresponding character for a specific keycode. For example when I type in

sudo showkey
//I get the response in the form
keycode num press/release

I was just wondering if I have the keycode, can I get the character mapping back so that I know which character I actually pressed?

Best Answer

Run xev from a terminal. This will give you a new window.

Place your mouse pointer in this window, type some keys and watch for results in the terminal.