ironh4x Posted September 8, 2009 Share Posted September 8, 2009 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? Link to comment Share on other sites More sharing options...
Inverted Posted September 8, 2009 Share Posted September 8, 2009 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. Link to comment Share on other sites More sharing options...
jvanegmond Posted September 8, 2009 Share Posted September 8, 2009 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 + fhotkeyset ("!"& 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. github.com/jvanegmond Link to comment Share on other sites More sharing options...
ironh4x Posted September 8, 2009 Author Share Posted September 8, 2009 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now