Page 1 of 1

I can not seem to hotkey numbers? 1:: dose not work when I press "1" to activate the script?

Posted: 17 Oct 2022, 18:37
by itisme
This does not work... when I press "1" to start/stop the script

Code: Select all

1::
    if !T
	gosub Press_e
    SetTimer, Press_e, % (T:=!T) ? 1000 : "Off"
return


Press_e:
    send 1
return
This does work when I press F2 to start / stop the script.

Code: Select all

F2::
    if !T
	gosub Press_e
    SetTimer, Press_e, % (T:=!T) ? 1000 : "Off"
return


Press_e:
    send 1
return
How do I use numbers (not the numpad numbers) as hotkeys?

Thanks

Re: I can not seem to hotkey numbers? 1:: dose not work when I press "1" to activate the script?

Posted: 17 Oct 2022, 18:53
by boiler
The problem is not that it’s a number, it’s that it’s the same key that you’re sending, which re-triggers your hotkey. Put a $ in front of the hotkey label. Explained here.