I didn't have an answer to my problem about adding additional keyboards in my Ubuntu 10.04. Questions mark is not working in my keyboard, only using Alt Gr key + W.

So, I don't know if this is a problem with Ubuntu or Virtualbox itself (I'm running it inside a VM).

It's an usb keyboard. HP KU-0316.

I would like to debug this problem. The keyboard is plugged in, so when I press a key I believe something is being sent to my operating system, some code, I don't know. I would like to digg this problem, find some damn key code and find some damn *.conf file and manually fix my problem.

So, do an application like this exist in Linux?


Try xev. It will display the keycodes that the X Window system sees when you press the keys you're interested in. You can use xmodmap to modify the mapping.

  • Exactly what I was thinking for! And when I press the key, nothing shoes... maybe a Virtualbox bug? – Somebody still uses you MS-DOS Jun 15 '10 at 13:51

An awesome utility from linux-input called 'evtest' is excellent at debugging keyboard, mice, and joysticks. Function keys should work too.

apt-get install evtest

Sample output from pressing the caps lock key while evtest running:

Event: time 1398955189.226822, type 17 (EV_LED), code 1 (LED_CAPSL), value 1
Event: time 1398955189.226822, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70039
Event: time 1398955189.226822, type 1 (EV_KEY), code 58 (KEY_CAPSLOCK), value 0
Event: time 1398955189.226822, -------------- SYN_REPORT ------------

Since evtest uses /dev/input, you can use it from a TTY or SSH, with no Xserver running.


There are so-called event device files which are bound into a very low level of input layer. They reside in /dev/input/ directory, and you can read keycodes that are passed by virtual PS/2 keyboard by doing sudo hd /dev/input/by-path/platform-i8042-serio-0-event-kbd. If this command fails, just try that with each of /dev/input/eventX files: one of them will be bound to your keyboard.

  • Any advice for when neither sudo hexdump /dev/input/by-path/*-kbd nor sudo hexdump /dev/input/event* has any output? My laptop keyboard works in BIOS but nowhere else. I can see output from the aforementioned commands only with my USB keyboard. – wpcarro Jul 31 '19 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.