GetKeyState inside of function
Posted: 01 Feb 2023, 18:21
Hello,
I'm playing around with custom modifier keys, so instead of Shift+4 something like F1+4
Normally I always did it this way:
I'm wondering if I could also create a function which does GetKeyState.
After several tries it did not work.
Is there something I have to do additionally?
Looks like the function only gets called, not actually held.
Thanks for any help and best regards
I'm playing around with custom modifier keys, so instead of Shift+4 something like F1+4
Normally I always did it this way:
Code: Select all
F1::
while GetKeyState("F1") ; Works fine
{
modifier := 1
}
modifier := 0
return
#if modifier
4::
Send hello
return
6::
Send test
#if
After several tries it did not work.
Code: Select all
F2::
Hold_Key()
return
Hold_Key()
{
while GetKeyState("F2", "P") ; No effect
{
modifier := 1
}
modifier := 0
}
Looks like the function only gets called, not actually held.
Thanks for any help and best regards