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 know how to use Autohotkey to remap keys and key combinations. If I bind Capslock to Ctrl, Capslock+Anykey will work like Ctrl+Anykey.

How can I bind CapsLock alone to another hotkey (Ctrl+1, for instance), but bind Capslock+Anykey to Ctrl+Anykey ?

share|improve this question
up vote 1 down vote accepted

Okay, I have an imperfect workaround:

Capslock::Control  ;--Holding Caps = holding Ctrl

Capslock Up:: ;--If you press Caps fast, it types "No"
SendInput, {Control Up}  ;--For stability
If A_TimeSincePriorHotkey < 100  ;--Vary the time as it suits you
Sendinput, No  ;--Replace with what you want Caps to do on its own

If you press Caps down for longer than 100 ms, then release it, nothing will happen. If you press it for less then 100ms, then release it, it will type "No". If you press any Key while holding it down, it will carry out control+Key. If you hold Caps down for less than 100ms and manage to press any Key before releasing Caps, it will carry out control+Key and type "No". You can vary the timing. This is the best I could do, perhaps there is a better way.

share|improve this answer
Very inventive. =) – Malabarba Dec 25 '10 at 7:05
Thanks! If you ever find a better way, please let me know. – Cerberus Dec 26 '10 at 2:52

I wrote a program in C++ that does this very thing. It remaps the Apps key rather than Capslocks, but it would be trivial to modify. The source code (and more info) is on github at

share|improve this answer

You must log in to answer this question.

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