I'm sorry if this is a stupid question, but I can't find the solution for the life of me.
I have a loop that defines a hotkey for each character a-z:
Loop, 26
Hotkey, % Chr(A_Index + 64), DoSomething
What I can't figure out is how to do this with a modifier symbol, e.g. "+" (Shift), so that the hotkey is only triggerd when I have Shift pressed together with the character.
define hotkey with modifier in loop
Re: define hotkey with modifier in loop
Code: Select all
Loop, 26
{
key := % Chr(A_Index + 64)
Hotkey, %key%, DoSomething
Hotkey, +%key%, DoSomethingElse
}
return
DoSomething:
DoSomethingElse:
MsgBox, % A_ThisHotkey
return
Re: define hotkey with modifier in loop
You can simply concatenate.
Code: Select all
Loop, 26
Hotkey, % "+" Chr(A_Index + 64), DoSomething
This is tolerated by the program, but invalid. The percent sign should be removed.key := % Chr(A_Index + 64)
Who is online
Users browsing this forum: Bing [Bot], JKJadan and 258 guests