l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2001 Dec 30 17:03

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] X key binding - win to crtl
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] X key binding - win to crtl

Awesome! Thanks for the tips! Here is how to map the windows key to

Use xev to find the keycode for the key you want to remap.
115 is the windows button and 117 is the menu button. (on my laptop
anyway) You can then use "xmodmap -pk" to see what is already mapped to
115. Probably nothing. The problem I had for a while was just using the
keycode command but not using the add command. The mapping would show up
in "xmodmap -pk" but no apps would realize it. The "add control..." line
was the key.

Make a file and call it something like .xmodmap. Put this in it.

! windows key
keycode 115 = Control_L
! menu key
keycode 117 = Control_R
add Control = Control_L Control_R

Then run "xmodmap .xmodmap". You can put this in your .xinitrc to make it

If you want to swap your control and caps lock and still map the windows
button to control put this in your .xmodmap. Note the position of the add
Control line. 

! swap caps and control
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
! make left windows key = left control
keycode 115 = Control_L
! make right menu key = right control
keycode 117 = Control_R
add Control = Control_L Control_R

On Sun, 22 Apr 2001, Peter Jay Salzman wrote:
> you can do this by finding the keycode of the "windows key" using xev and
> then mapping the keycode using xmodmap.
> you can then put the xmodmap in one of your startup files (make sure it
> doesn't run in console; it'll generate an error).
> man xmodmap should give pretty explicit instructions on how to map a
> particular keycode to the control key.

Dale Bewley - Bewley Internet Solutions Inc. http://bewley.net/

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!