Code: Select all
shiftState := GetKeyState("Shift", "P") ? 1 : 0
ctrlState := GetKeyState("Ctrl", "P") ? 2 : 0
altState := GetKeyState("Alt", "P") ? 4 : 0
lWinState := GetKeyState("LWin", "P") ? 8 : 0
state := ctrlState + shiftState + altState + lWinState
Atm there are only 16 options (0-15) but if I add more keys to it this list will grow extensivly.
Atm I'm doing it one by one and I guess there is a more elegant way...
Code: Select all
if (state == 0)
modifier := ""
else if (state == 1)
modifier := "+"
...
else if (state == 15)
modifier := "+^!<#"