Functions with memory?!? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
HHHPepperHHH
Posts: 2
Joined: 17 Jul 2021, 18:01

Functions with memory?!?

27 Jul 2021, 10:57

Hello, I was goofing around with keybinding scripts, trying to make it so the last pressed key activates the function, but oddly the function also uses the previous hotkeys too. I don't know if I described the issue well but the thing is that it "infects" or "remembers" the keys used

Code: Select all

;VARIABLES
Var := 1

;GUI
Gui, New,, Silent Mouse Controller
Gui, Add, Button, w100 gLMouseB vLMouseControl, 1 ; The button is added
Gui, Show
Return


;FUNCTIONS
LMouseB: ; When the button is pressed, Var will change to the next input
Input, Var, L1 V
GuiControl, Text, LMouseControl, % Var
Hotkey, %Var%, Func ; Then that input becomes a hotkey
Return

Func: ; And the hotkey does the thing
MouseClick, Left
return

;die lol
GuiClose:
ExitApp

Esc::
ExitApp
User avatar
mikeyww
Posts: 26859
Joined: 09 Sep 2014, 18:38

Re: Functions with memory?!?  Topic is solved

27 Jul 2021, 11:34

See Hotkey. Enabling a key does not disable other keys, but you can use the command's "Off" option to do that.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, mmflume, scriptor2016, ShatterCoder and 98 guests