Help with GUI Varibles

Get help with using AutoHotkey and its commands and hotkeys
CorruptingNostalgia
Posts: 10
Joined: 17 Apr 2020, 08:44

Help with GUI Varibles

09 Sep 2020, 09:38

I need help with variable in guis. Can someone edit the script below so that when you change the edit and the chosen hotkey the variable instantly registeres the changes (if the user presses enter or deselects the text by clicking outside the box, you know what i mean?). the changes then applies the the hotkey and sleep functions as underlined .

Code: Select all

Gui, Show , w200 h100, Hold To Click Application
gui, add, text, section, Start/Pause Hotkey:
Gui, Add, Hotkey, vChosenHotkey
gui, add, text, section, Intervals:
Gui, Add, Edit, VInterval vMyEdit w100 number, Milliseconds
return

ChosenHotkey::
Sleep, Intervals
Click
As always, thanks in advanced :D :D .
Last edited by BoBo on 09 Sep 2020, 11:50, edited 1 time in total.
Reason: Added [code][/code]-tags. Do this on your own from now on!
User avatar
mikeyww
Posts: 3995
Joined: 09 Sep 2014, 18:38

Re: Help with GUI Varibles

09 Sep 2020, 20:22

Code: Select all

; Demonstrate hotkey selection
; https://www.autohotkey.com/boards/viewtopic.php?f=76&t=80829

gui, Add, text, section, Start/Pause Hotkey:
Gui, Add, Hotkey, vChosenHotkey
gui, Add, text, section, Intervals:
Gui, Add, Edit, vInterval w100 number, 1000
Gui, Add, Button, Default w80, Register
Gui, Show, w200, Select a hotkey
Return

GuiClose:
ButtonRegister:
Gui, Submit
If ChosenHotkey {
 StringUpper, ChosenHotkey, ChosenHotkey, T
 Hotkey, %ChosenHotkey%, Wait
 MsgBox,, Done, Try pressing %ChosenHotkey% now.
} Else MsgBox, 48, Empty, Nothing was registered.
Return

Wait:
MsgBox, 64, You pressed '%ChosenHotkey%', Let's wait for %Interval% milliseconds!
Return

Return to “Ask For Help”

Who is online

Users browsing this forum: audante, Chunjee, Google [Bot], mikeyww, reklamescobar, RyantheCoder, SenseElation, vilson yuri and 36 guests