Toggle Rebound key

Get help with using AutoHotkey and its commands and hotkeys
feedcoma
Posts: 1
Joined: 08 Nov 2019, 13:35

Toggle Rebound key

08 Nov 2019, 13:52

Hi, literal first time using AHK. How would I go about binding a hotkey to activate and deactivate the following:

Code: Select all

LButton::LAlt
So if I press the hotkey, LButton is remapped to LAlt and if I press the hotkey again, LButton goes back to LButton.

Thanks.
User avatar
TheDewd
Posts: 1391
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Toggle Rebound key

08 Nov 2019, 14:00

Code: Select all

#SingleInstance, Force

Toggle := 0 ; Initialize variable
return

F12:: ;<-- F12 Hotkey
	Toggle := !Toggle ; Toggle variable to 1 or 0
return

#If (Toggle) ; If Toggle variable = 1
	LButton::LAlt
#If
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.

Return to “Ask For Help”

Who is online

Users browsing this forum: barbaque, Bing [Bot], colt, Getfree, kdservices and 171 guests