3

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 ?

2 Answers 2

1

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
}
Else
return
return

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.

2
  • Very inventive. =)
    – Malabarba
    Dec 25, 2010 at 7:05
  • Thanks! If you ever find a better way, please let me know.
    – Cerberus
    Dec 26, 2010 at 2:52
1

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 https://github.com/russelldavis/KeyFix4000

You must log in to answer this question.

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