16

I want to combine CapsLock Alt k keys in a single hotkey, such as this:

CapsLock & !k:: Send !{Up}

This doesn't work because Autohotkey doesn't allow the combination of more than two keys except the modifier keys.

Searching for a solution I found out that using scan codes in left hand side might be a work around, such as:

SC035 & !k:: Send !{Up}

I tested this solution too but this doesn't work properly neither. In this case, pressing CapsLock+k triggers the hotkey.

Mert Nuhoglu
  • 2,370
  • 3
  • 29
  • 36

1 Answers1

15

How about this?

Capslock & k:: 
GetKeyState, state, Alt
if state = D
SendInput !{Up}
Return 
snitzr
  • 2,212
  • 4
  • 25
  • 32
  • Thank you. This works really. But now there is a slight delay when using CapsLock combined with a key, such as "CapsLock&a::=". This delay is probably due to GetKeyState function, isn't it? – Mert Nuhoglu Jul 08 '10 at 07:23
  • I tested, but could not recreate this delay. The script should be self-contained and not affect the performance of other scripts. Scripts that have GetKeyState to add a third hotkey (like the one I have above) will not behave exactly like scripts with normal hotkey setups and may prevent the script repeating as fast as usual. Hope that helps. – snitzr Jul 08 '10 at 12:41
  • 3
    I prefer this more concise syntax and thought I'd share it with you: if not GetKeyState("Alt", "P")... Modify according to your needs. Cheers. – Mario Awad Jun 27 '12 at 17:53