Jump to content

Recommended Posts

Posted

Hi guys I'm trying to make a hotkey that a user can choose what they want to bind.

1 GUICtrlCreateInput that will ask the user.

for example the user put "f"

so the hotkey is alt + f

hotkeyset ("!"& GUICtrlRead ($input1),"msgbox")

whats wrong with that im doing?

Posted

Hi guys I'm trying to make a hotkey that a user can choose what they want to bind.

1 GUICtrlCreateInput that will ask the user.

for example the user put "f"

so the hotkey is alt + f

hotkeyset ("!"& GUICtrlRead ($input1),"msgbox")

whats wrong with that im doing?

You can't define a function "msgbox" because "msgbox" is a native function. Also, you can't call native functions from a hotkey. Either way, using "msgbox" is bad.
Posted

tnx guys, knowing that the code really works I figured out what am I doing wrong.

GuiCreate("sample",258,256,415,272)
$button1=GuiCtrlCreateButton("ok",9,39,50,20)
$input1=GuiCtrlCreateInput("",91,15,130,20)
HotKeySet("!"& GUICtrlRead($input1), "num1") <-------this line should be inside the while loop, sorry guys Im just starting to learn. tnx
GuiSetState()



While 1

$msg=GuiGetMsg()
If $msg=-3 Then Exit
If $msg=$button1 Then button1()
Wend

Func button1()
MsgBox(4096, "Test", GUICtrlRead($input1), 10)
EndFunc

Func num1()     
MsgBox(4096, "Test", GUICtrlRead($input1), 10)
EndFunc

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...