LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 02: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, 11:57 AM   #2
ajlewis2
Member
 
Registered: Nov 2003
Distribution: Ubuntu
Posts: 218

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, 05: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, 08: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



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 12:58 PM
AltGr key does not work OlegL Debian 5 09-17-2004 02:22 AM
AltGr key does not work OlegL Linux - Laptop and Netbook 2 08-30-2004 09:35 AM
X.org AltGR key problem wigry Slackware 3 07-18-2004 12:15 PM
AltGr key not working in X iceman47 Linux - Software 3 03-07-2004 06:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 PM.

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
Open Source Consulting | Domain Registration