LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 02-02-2009, 03:46 AM   #1
krisrao
LQ Newbie
 
Registered: May 2004
Location: Birmingham, UK
Distribution: Mandrake
Posts: 9

Rep: Reputation: 0
Mapping AltGr key to act as WIN key


Hi,
I use ubuntu on a thinkpad X31 with PC102 keyboard with no WIN key. I wish to map the Rt Alt (AltGr) key to act as WIN key (for compiz shortcuts)
How can I do this?
Thanks in advance,
Krishna
 
Old 02-02-2009, 12:57 PM   #2
ajlewis2
Member
 
Registered: Nov 2003
Distribution: Ubuntu
Posts: 217

Rep: Reputation: 46
First you need to find out what the keycode is for the key you want to map. Bring up a terminal and type in the following, followed by the Enter key:

Code:
xev
Then press on the Right Alt key. In the terminal you will see something like this:

Code:
KeyRelease event, serial 31, synthetic NO, window 0x3800001,
    root 0x5e, subw 0x0, time 9174459, (-616,-31), root:(482,587),
    state 0x8, keycode 113 (keysym 0xffeb, Alt_R), same_screen YES,
The part you need to know is the keycode which here is 113.

The other thing you need to know is Super_L is the name of the left windows key.

Close xev and in the terminal go to your home directory and make a file called .Xmodmap. I doubt that you already have one. Use whatever text editor you know, but don't use a word processor. I show using nano here.:

Code:
cd
nano .Xmodmap
In the file type. Substitute the keycode that you found in xev for the 113:
Code:
keycode 113 = Super_L
After this, log off and back on to incorporate the new addition to your keymapping. After this when you run xev and press the key, you should see Super_L instead of Alt_R.
 
Old 02-02-2009, 06:30 PM   #3
krisrao
LQ Newbie
 
Registered: May 2004
Location: Birmingham, UK
Distribution: Mandrake
Posts: 9

Original Poster
Rep: Reputation: 0
Works!

Strangely enought the .Xmodmap didn't work with wmii (where I like to use Mod4 as the modifier)
Based on your solution I created a .xsessionrc in my home folder with this line:
xmodmap -e "keycode 108 = Super_L"
This seems to work like a charm.
Thanks for your help
 
Old 02-11-2009, 09:14 PM   #4
wisonlee
LQ Newbie
 
Registered: Feb 2009
Posts: 1

Rep: Reputation: 0
no tweak!

Quote:
Originally Posted by krisrao View Post
Hi,
I use ubuntu on a thinkpad X31 with PC102 keyboard with no WIN key. I wish to map the Rt Alt (AltGr) key to act as WIN key (for compiz shortcuts)
How can I do this?
Thanks in advance,
Krishna
under ubuntu 8.10, system->Preferences->Keyboard->Layouts(tab)->Other Options->Alt/Win key behavior->select "Left Alt is swapped with left win key"

enkoy!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AltGr-key on debian-ppc working! ElPuello LinuxQuestions.org Member Success Stories 2 10-26-2004 01:58 PM
AltGr key does not work OlegL Debian 5 09-17-2004 03:22 AM
AltGr key does not work OlegL Linux - Laptop and Netbook 2 08-30-2004 10:35 AM
X.org AltGR key problem wigry Slackware 3 07-18-2004 01:15 PM
AltGr key not working in X iceman47 Linux - Software 3 03-07-2004 07:27 PM


All times are GMT -5. The time now is 03:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration