Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to map control Ctrl+Left to Home and Ctrl+Right to End, and I'm using AutoHotkey, my script is simply this:


However, when the Home and End keys are generated, they are interpreted at Ctrl+Home and Ctrl+End because I'm holding down the Ctrl key to generate them. How can I disable the Ctrl key or any modifier key when reassigning keys?

share|improve this question
up vote 3 down vote accepted

It looks like you can just use Send:

^Left::Send {Home}
^Right::Send {End}

;Doesn't work with Shift, so we can add that manually:

+^Left::Send +{Home}
+^Right::Send +{End}

;You can add any other modifier keys you need to work.

It appears using Send will temporarily release any modifier keys already held down, so that the output of Send won't be affected by them -- unless you specifically use {Blind} to preserve modifier keys already held down.

The a::b format is used to remap keys and preserves any modifiers held down. (It actually internally uses Send {Blind}.)

share|improve this answer
Thanks, this is exactly what I wanted! – oggmonster Sep 2 '11 at 7:31


KeyWait Control

KeyWait Control

If you just need any code for this and it doesn't need to be autohotkey, AuotIt should work:

HotKeySet("^{LEFT}", "Home")
HotKeySet("^{RIGHT}", "End")
HotKeySet("{ESC}", "Terminate")

While 1

Func Home()

Func End()

Func Terminate()
    Exit 0
share|improve this answer
I guess this could kinda work, it would be really nice if AutoHotkey could just somehow disable modifier keys temporarily; I want this short cut for text editing in particular IDEs so having to release Ctrl before the line is skipped will be a bit annoying when I'm selecting a line to copy: Shift+Ctrl+Left->Release Ctrl->Ctrl+C – oggmonster Sep 1 '11 at 21:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .