Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On my laptop, I use Emacs. However, I don't have a left Ctrl key, and I considered mapping the left Alt key to left Ctrl and the right Alt key (Alt Gr) to just Alt (Meta). This way, I can just hit the keys with my thumbs. How would I do this?

I'm using Windows right now, but I also might want to try this on Linux later.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can remap virtually any key to any other key using AutoHotkey. Check out the remap site: http://www.autohotkey.com/docs/misc/Remap.htm

The code should have worked:

LAlt::LCtrl
LControl & RAlt::Alt

For a complete List of keys look here: http://www.autohotkey.com/docs/KeyList.htm


EDIT:

since this solution does not work (for whatever reason), I suggest looking at this answer on StackOverflow: http://stackoverflow.com/questions/229633/how-to-globally-map-altgr-key-to-alt-key

This guy had the same problem and managed to remap Alt Gr to Alt in the registry (which is more reliable anyway).

share|improve this answer
    
I get: "Error at line 2. Line Text: Alt. Error: This line does not contain a recognized action." –  AnimatedRNG Apr 22 '12 at 15:24
    
darn, this shoulda worked. Sorry. I get the same error. Corrected the answer with new info. –  user 99572 is fine Apr 22 '12 at 21:17

On linux you can use xev and xmodmap.

Start xev from a terminal and look at its output to figure out what's the keycode of your to key.

KeyPress event, serial 36, synthetic NO, window 0x1400001,
    root 0x15a, subw 0x0, time 2274037, (436,185), root:(437,636),
    state 0x0, keycod*emphasized text*e 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

Here the keycode of my Alt_L key is 64. Now use xmodmap to assign a new keysym to this keycode.

xmodmap -e "keycode 64 = Control_L"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.