Using variables as hotkeys for actions.

Propose new features and changes
User avatar
fx_spencer
Posts: 6
Joined: 06 Dec 2021, 07:45
Contact:

Using variables as hotkeys for actions.

Post by fx_spencer » 06 Dec 2021, 08:58

Be able to use:

Code: Select all

Gui Add, Editbox, x100 y100 +Limit1 vEdit1

GuiControlGet, Edit1

%Edit1%::
MsgBox, You pressed the key that you've input on Edit1!

return
Or

Code: Select all

%Edit1%::
MsgBox, You pressed the key that you've input on Edit1!

return
Without any complication

User avatar
Xtra
Posts: 2744
Joined: 02 Oct 2015, 12:15

Re: Using variables as hotkeys for actions.

Post by Xtra » 06 Dec 2021, 12:34

Code: Select all

Gui, Add, Edit, x100 y100 +Limit1 gSetHotkey vEdit1
Gui, Show
return

SetHotkey:
    Gui, Submit, NoHide
    Hotkey, % %A_GuiControl%, % A_GuiControl
return

Edit1:
    MsgBox, You pressed the key %A_ThisHotkey% that you've input on %A_ThisLabel%!
return

GuiClose:
GuiEscape:
    ExitApp

Post Reply

Return to “Wish List”