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.

link|improve this question

71% accept rate
(In AutoHotkey, Ctrl is ^, Alt is !. You might clarify which one you want.) – Bavi_H Jul 8 '10 at 2:02
I corrected the mistake. – Mert Nuhoglu Jul 8 '10 at 6:17
feedback

1 Answer

up vote 3 down vote accepted

How about this?

Capslock & k:: 
GetKeyState, state, Alt
if state = D
SendInput !{Up}
Return 
link|improve this answer
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 8 '10 at 7: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 8 '10 at 12:41
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.