Wait for HotKeys after of Input Dialog Box Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mora145
Posts: 57
Joined: 25 Jun 2022, 15:31

Wait for HotKeys after of Input Dialog Box

Post by mora145 » 06 Dec 2022, 10:45

Greetings friends.

I have a small script that what it does is to repeat the sending of the keys J and A, triggered by two HotKeys, 1 and 2. The question is that before all this starts a dialog box is shown that asks the user how many times the loop will be repeated, but as my keys 1 and 2 are already reserved as HotKeys, they can not be used. Is there any way to tell AHK to wait until the dialog box closes to reverse the HotKeys?

Code: Select all

#SingleInstance, Force
SendMode Input

Beggin:
InputBox, UserInput, Phone Number, Please enter a loop number (Using the NumPad keys)., , 300, 150
if ErrorLevel{
    MsgBox, CANCEL was pressed.
    ExitApp
}

1::
Loop, %UserInput%
{
    Send, {A}
    Sleep, 10
}
return

2::
Loop, %UserInput%
{
    Send, {J}
    Sleep, 10
}
return

Esc::
MsgBox, 4,, Would you like to continue? (press Yes or No)
IfMsgBox Yes
   Goto, Beggin
else
    ExitApp

User avatar
mikeyww
Posts: 27095
Joined: 09 Sep 2014, 18:38

Re: Wait for HotKeys after of Input Dialog Box  Topic is solved

Post by mikeyww » 06 Dec 2022, 11:46

You could use the Hotkey command to enable or disable the hotkeys when you wish. Alternatively, #If can be used to set a context for them.

mora145
Posts: 57
Joined: 25 Jun 2022, 15:31

Re: Wait for HotKeys after of Input Dialog Box

Post by mora145 » 06 Dec 2022, 12:06

mikeyww wrote:
06 Dec 2022, 11:46
You could use the Hotkey command to enable or disable the hotkeys when you wish. Alternatively, #If can be used to set a context for them.
Ty :) is done

Post Reply

Return to “Ask for Help (v1)”