Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have bought a (DIGITECH XC-4943) multi-media keyboard. It has no manual and some of the keys are not labelled. Is there a utility (or some delphi code) I can use to display the messages that each key sends ?

share|improve this question
1  
The xev tool under X or showkey program under Linux console will report this information. –  sarnold Jul 24 '12 at 4:01
add comment

migrated from stackoverflow.com Jul 25 '12 at 9:05

This question came from our site for professional and enthusiast programmers.

1 Answer

You have different options depending on the OS you use.

First, you must know a few terms: A scancode is the lowest identification number for a key. If a key does not have a scancode then we cannot do anything because it means that the kernel does not see it. A keycode is the second level of identification for a key, a keycode corresponds to a function. A symbol is the third level of identification for a key, it is the way Xorg refers to keys.

As a Linux user, you can use the showkey command in a TTY terminal to check for keycodes. Do not use this under a Terminal Emulator on Xorg. If you wish to use a Terminal Emulator, use the xev command from the xorg-xev package.

If you do not see a keycode on your screen against a keypress, you must take a chance with finding its scancodes and assigning a keycode to them.

Press the key on a TTY Terminal and then execute:

$ dmesg|tail -5

If you see something akin to this:

atkbd.c: Unknown key pressed (translated set 2, code 0xf1 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e071 <keycode>' to make it known.

You know that the kernel recognizes the keypress, but has no keycode assigned to it. Use the setkeycodes as mentioned to assign a keycode to the scancode.

EDIT: Let me know if you want more information on doing all this from within Xorg. Or for further information on creating and assigning special keys.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.