NegativeNrG Posted December 5, 2005 Share Posted December 5, 2005 Im having problems with hotkeyset() function. For example $input = Inputbox("Assign a hotkey","Input your hotkey to be set") if $input = "F1" Then Hotkeyset("{F1}","click") if $input = "F2" Then Hotkeyset("{F2}","click") If $input = "F3" Then Hotkeyset("{F3}","click") This script is jsut an example. my real script has GUIs and stuff. now when i press button1 it opens up a inputbox and i enter F1 so then it assigns it to F1 as a hotkey. now when i press button1 again to assign a new hotkey i enter F2. BUT F1 key still works. and when i assign it to F3 F1 and F2 still works. any solutions? [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
themax90 Posted December 5, 2005 Share Posted December 5, 2005 (edited) $Input = Inputbox("Assign a hotkey","Input your hotkey to be set") If @Error = 0 Then If IsDeclared('Buffer') <> 0 Then HotKeySet("{" & $Buffer & "}") HotKeySet("{" & $Input & "}", "Click") $Buffer = $Input EndIf First it tests is $Input box actually returned something and was not canceled. If it is, then It unbinds the previous hotkey as according to buffer, and binds a new one according to your input. Edited December 5, 2005 by AutoIt Smith Link to comment Share on other sites More sharing options...
NegativeNrG Posted December 5, 2005 Author Share Posted December 5, 2005 Thanks A bunch Smith, it does work nicely. [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
NegativeNrG Posted December 5, 2005 Author Share Posted December 5, 2005 argh, i have another problem, i have: 2 buttons(set hotkey1 and set hotkey2) when i assign a hotkey to Button1 and Button2 only Button2 works, but Button 1 doesnt and if i assign a hotkey to Button2 first, Then Button1, Button1 works but not Button2 Any Solutions? [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
themax90 Posted December 5, 2005 Share Posted December 5, 2005 I don't understand, isn't that what you wanted? Link to comment Share on other sites More sharing options...
Nuffilein805 Posted December 5, 2005 Share Posted December 5, 2005 (edited) maybe you should do 2 inputboxes if $input <> "" then hotkeyset("{"&$input&"}", "") $input = Inputbox("Assign a hotkey","Input your hotkey to be set") if $input = "F1" Then Hotkeyset("{F1}","click") if $input = "F2" Then Hotkeyset("{F2}","click") if $input = "F3" Then Hotkeyset("{F3}","click") if $secinput <> "" then hotkeyset("{"&$secinput&"}", "") $secinput = Inputbox("Assign second hotkey","Input your hotkey to be set") if $secinput = "F1" Then Hotkeyset("{F1}","click2") if $secinput = "F2" Then Hotkeyset("{F2}","click2") if $secinput = "F3" Then Hotkeyset("{F3}","click2") maybe this is helping you Edited December 5, 2005 by Nuffilein805 my little chatmy little encryption toolmy little hidermy unsafe clickbot 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