Sign in to follow this  
Followers 0
ironh4x

problem with hotkeyset * help

4 posts in this topic

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?

Share this post


Link to post
Share on other sites



It works fine, I tested it. Example :

HotKeySet ("!"&GUICtrlRead($Input1), "Function1")

Are you sure your function is called "msgbox" ?! Post your code if you have more problems.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0