hlstriker Posted May 19, 2005 Posted May 19, 2005 I am trying to make a HotKeySet read from a combo box (drop down menu). I can't get it to read the key in the combo box though. Here is the code I am trying... $keyselect1 = GuiCtrlCreateCombo("Select Key", 60, 50, 100, 22) GUICtrlSetData(-1,"{HOME}|{END}") $key = GUICtrlRead($keyselect1) HotKeySet($key,"start") Thanks. The best Honda forums!RuneScape High Alching for Profit!
hlstriker Posted May 19, 2005 Author Posted May 19, 2005 (edited) Anyone have any ideas? *B.umping* *U.p* *M.y* *P.ost* Edited May 19, 2005 by hlstriker The best Honda forums!RuneScape High Alching for Profit!
Developers Jos Posted May 19, 2005 Developers Posted May 19, 2005 (edited) Anyone have any ideas?*B.umping**U.p**M.y**P.ost*<{POST_SNAPBACK}>ahh .. yes 30 minutes is slow isn't it.... Maybe your posted example isn't very clear...You want to use a hotkey which will start func Start() but no code is shown.It helps in general if you post a small but working script that shows your issue... Edited May 19, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
hlstriker Posted May 19, 2005 Author Posted May 19, 2005 Sorry for bumping so soon Anyhow, the code I have works fine if I just have the HotKeySet name as {HOME} and not as $key... Example: HotKeySet("{HOME}","start") When I try and add the variable... $key ...nothing happens. I want it to read from my combo box and have the key from the combo box be in place of where "{HOME}" is on the HotKeySet. Here is the code I used again... $keyselect1 = GuiCtrlCreateCombo("Select Key", 60, 50, 100, 22) GUICtrlSetData(-1,"{HOME}|{END}") $key = GUICtrlRead($keyselect1) HotKeySet($key,"start") The best Honda forums!RuneScape High Alching for Profit!
Developers Jos Posted May 19, 2005 Developers Posted May 19, 2005 Sorry for bumping so soon Anyhow, the code I have works fine if I just have the HotKeySet name as {HOME} and not as $key...Example:HotKeySet("{HOME}","start")When I try and add the variable... $key ...nothing happens. I want it to read from my combo box and have the key from the combo box be in place of where "{HOME}" is on the HotKeySet.Here is the code I used again...$keyselect1 = GuiCtrlCreateCombo("Select Key", 60, 50, 100, 22) GUICtrlSetData(-1,"{HOME}|{END}") $key = GUICtrlRead($keyselect1) HotKeySet($key,"start")<{POST_SNAPBACK}>Maybe you need to use :GUICtrlSetData(-1,"{HOME}|{END}","{HOME}")To set the default selection to {Home} ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
hlstriker Posted May 19, 2005 Author Posted May 19, 2005 (edited) Ok, that worked for {HOME} key, but now when I choose {END} from the combo box, it is still set on {HOME} for the HotKeyset. I don't know why it won't change to {END} when it is set on it? Edited May 19, 2005 by hlstriker The best Honda forums!RuneScape High Alching for Profit!
Developers Jos Posted May 19, 2005 Developers Posted May 19, 2005 Ok, that worked for {HOME} key, but now when I choose {END} from the combo box, it is still set on {HOME} for the HotKeyset. I don't know why it won't change to {END} when it is set on it?<{POST_SNAPBACK}>well, that works like any other gui...something like:#include <GUIConstants.au3> GUICreate("My GUI") ; will create a dialog box that when displayed is centered $keyselect1 = GuiCtrlCreateCombo("Select Key", 60, 50, 100, 22) GUICtrlSetData(-1,"{HOME}|{END}") $key = GUICtrlRead($keyselect1) HotKeySet($key,"start") GUISetState () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $keyselect1 Then $key = GUICtrlRead($keyselect1) HotKeySet($key,"start") EndIf Wend SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
hlstriker Posted May 19, 2005 Author Posted May 19, 2005 That sort of works. Now what happens is...Say you select the {HOME} key. It will work.Then you will select the {END} key, and that will work... Along with the {HOME} key!!!I want it so when either one or the other key is selected, only the one will make the function work. Any ideas? Thanks for all the help so far JdeB The best Honda forums!RuneScape High Alching for Profit!
Helge Posted May 19, 2005 Posted May 19, 2005 This removes the hotkey for home : HotKeySet("{HOME}") I think you'll get it from there..
MSLx Fanboy Posted May 19, 2005 Posted May 19, 2005 You have to unregister the function from the hotkey #include <GUIConstants.au3> Func start() MsgBox(0, "test", "success!") EndFunc GUICreate("My GUI"); will create a dialog box that when displayed is centered $keyselect1 = GuiCtrlCreateCombo("Select Key", 60, 50, 100, 22) GUICtrlSetData(-1,"HOME|END") $key = GUICtrlRead($keyselect1) HotKeySet($key,"start") GUISetState () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $keyselect1 Then $key = GUICtrlRead($keyselect1) HotKeySet("{HOME}") HotKeySet("{END}") HotKeySet("{" & $key & "}","start") EndIf Wend Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
hlstriker Posted May 19, 2005 Author Posted May 19, 2005 Woohoo!!! Thank you all for your help! I got it working The best Honda forums!RuneScape High Alching for Profit!
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