X11 | 8bit characters | xmodmap , latin1 keysyms , compose sequences | app resources, xterm | xmond | xev | mem footprints
Various | Home


Let xev(1) also show modifiers

original source and a patch


(If you already have xkeycaps (http://www.jwz.org/xkeycaps/), there's no real need for xev. But it's even working when the keyboard layout ever is unknown to xkeycaps.)


You don't have xev(1) on your system? Unfortunately, and IMHO wrongly, it's not an X11 core utility, so it's not always contained in a base X11 install.

You might be running SunOS or HP-UX (some versions of these don't ship it). However, if you have a *BSD or Linux distribution, then you should be able to get a precompiled package. The package name might reflect that it's X11 contrib stuff originally.

Don't forget that you should be able to run xev(1) from any other host as well, as long as you can open an X11 connection to your DISPLAY from there.

And note, that xev(1) seems to be available by default on SunOS 4.1.4, 5.6 and 5.8, residing in /usr/openwin/demo/ and not in /usr/openwin/bin/, where it would belong to.


Having applied patches to the original source, it's a bit more convenient to use xmodmap(1) to configure all the modifiers, because you can verify more easily what modifiers are actually active at a time. But this is usually only important when you are debugging problems.

For example, the following happens when your X11 keymap is configured to print 'ä' (a-umlaut) by using "Mode_switch" aka "AltGr"). (See a page about xmodmap how to do key mapping).

Pressing "Shift_L + Mode_switch + Button1 + a" results in:

	[...]
	KeyPress event, serial 20, synthetic NO, window 0xc00001,
	    root 0x29, subw 0x0, time 3597874685, (102,54), root:(322,354),
	    state 0x109, keycode 84 (keysym 0xc4, Adiaeresis), same_screen YES,
	    modifier: shift mod1 Button1
	    XLookupString gives 1 characters:  "Ä"
	[...]
(Yes, actually buttons are also modifiers.)

The patch also offers the option '-l' to limit output to key and button events only.