Hotkey for Spacebar

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Vid_Player
Posts: 2
Joined: 05 Jun 2018, 13:25

Hotkey for Spacebar

05 Jun 2018, 13:34

Hi, I'm new to this whole hotkey thing. I need a script that presses space every few seconds.

I want the number 9 to activate a separate hotkey. I'd like this hotkey to be triggered by spacebar, and when spacebar is pressed, it will press space every 2.75 seconds. Can anyone send me the script needed for this? thanks
Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Hotkey for Spacebar

06 Jun 2018, 01:52

Hallo,
try:

Code: Select all

Hotkey, $*Space, Off
Return ;End of Auto-execute Section https://autohotkey.com/docs/Scripts.htm#auto
;I want the number 9 to activate a separate hotkey ($*Space)
*9::Hotkey, $*Space, % (Toggle := !Toggle) ? "On" : "Off"
;I'd like this hotkey to be triggered by spacebar,
;and when spacebar is pressed, it will press space every 2.75 seconds.
$*Space::
	SendInput, {Space}
	SetTimer, Space, 2750
	KeyWait, Space
	SetTimer, Space, Off
Return
Space:
	SendInput, {Space}
Return
Vid_Player
Posts: 2
Joined: 05 Jun 2018, 13:25

Re: Hotkey for Spacebar

21 Jul 2018, 18:09

Thanks very much!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Ineedhelplz and 320 guests