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 remap the Caps Lock key to send Ctrl+Alt+Shift, but I want to also send any keys that I pressed after it.

For example, if I press Caps Lock+t then I want AHK to send Ctrl+Alt+Shift+t likewise, if I press Caps Lock+j then I want to send Ctrl+Alt+Shift+j.

The following doesn't work because it sends it before I press any trailing keys. (i'm doing this so I can map shortcuts to Ctrl+Alt+Shift+[key] and use the Caps Lock key to execute them.

Capslock::send {^~+}
share|improve this question
    
Probably should be on SO. – Hello71 Jul 27 '10 at 17:00
    
Related question that may or may not help you: superuser.com/questions/168335/… – JNK Jul 27 '10 at 17:01
3  
@Hello71 - Do they send AHK stuff to SO? I thought it seemed appropriate to be here. – JNK Jul 27 '10 at 17:02
    
@JNK: I guess it's more complicated AHK questions that get migrated to SO, doing a quick check. – Hello71 Jul 27 '10 at 19:33
1  
Be aware that in AutoHotkey Alt is ! not ~. – Bavi_H Jul 30 '10 at 4:08
up vote 6 down vote accepted

I looked in the AutoHotkey help file under "Remapping keys and buttons". The general pattern is a::b will make pressing key a send key b instead. However, I couldn't get any of the following to work properly.

CapsLock::^!+
CapsLock::^!Shift
CapsLock::^!LShift

But that same help page describes how AutoHotkey internally translates the a::b remapping into two hotkey mappings. I used that example to make the following working script.

*CapsLock::
  SetKeyDelay -1
  Send {Blind}{Ctrl DownTemp}{Alt DownTemp}{Shift DownTemp}
return

*CapsLock up::
  SetKeyDelay -1
  Send {Blind}{Ctrl Up}{Alt Up}{Shift Up}
return
share|improve this answer

You must log in to answer this question.

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