-   Linux - Newbie (
-   -   Using winkey et al as modifier / compose keys (

noranthon 02-18-2007 07:20 PM

Using winkey et al as modifier / compose keys
I'd like to set up the winkeys to be of some use. Evidently, you can make one the "compose" key, whatever that means: see this page which is as incomprehensible as the best Linux documentation. I tried "xev" but could not make head or tail of the output.

So, I tried to find out which key number (keycode?) is assigned to each winkey. "showkey -k" got this:

$ showkey -k
kb mode was RAW
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

KDSKBMODE: Operation not permitted
Don't try showkey -m. It can't be stopped with Ctrl+C and if you close the console in desperation, numerous other windows open instead.


! This is the "Xmodmap" file for Standard Keyboards with Windows keys.
! If you want to have other keymappings for special X-Terminals, just
! create a "Xmodmap.${DISPLAY}" file with the according changes.

keycode 22 = BackSpace
keycode 115 = F13
keycode 117 = Menu
Since I don't have "special X-Terminals" (at least, I hope I don't), I suppose I could add to this file. (Or is that too easy?) But I still have to know what number to use and how to describe the keys and to assign insertion of various symbols to various keybindings.

How do I find out the codes of keys, assign a meaning to a keycode and subsequently assign symbols to various key combinations? I looked at the files mentioned in this old post but found nothing illuminating. All other previous posts I could find were too cryptic or not on point. Onk and major head scratch. :scratch:

johngreenwood 02-18-2007 07:32 PM

What do you want it to do?
To use xev is very easy, just run it and look for this when pressing the windows key.

KeyPress event, serial 28, synthetic NO, window 0x2200001,
    root 0x3f, subw 0x0, time 955730, (392,-358), root:(402,257),
    state 0x10, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 31, synthetic NO, window 0x2200001,
    root 0x3f, subw 0x0, time 955831, (392,-358), root:(402,257),
    state 0x50, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:

In there you can see the keycode for my windows key is 115, this is the code you need for xmodmap.

noranthon 02-19-2007 01:40 AM

Thanks. Some other key was recorded at the same time but I've confirmed the number with repeated presses. Now what? I just add a line to Xmodmap:

keycode 115 = Multi_key
? That can't be right; it's never that simple. :o

EDIT: No. It's not that simple. You are limited to /usr/X11R6/lib/X11/locale/iso8859-1/Compose - so you need to alter that to include characters you want.

And what's this "dead key" business?

johngreenwood 02-19-2007 09:48 AM

I'm afraid I can't help you there, sorry. I only know how to make it bring up the kmenu.

Emerson 02-19-2007 10:12 AM

noranthon 02-20-2007 05:43 AM

Ah, a new route altogether. :study: Thank you.

wensveen 03-15-2007 12:14 PM

Is there any way to make the windows key bring up the menu with AND make win+e open a file manager? I use Gnome and it seems it's either a composable button (<Mod4>) or a single button (Super_L).

All times are GMT -5. The time now is 04:32 AM.