Relive Posted August 9, 2011 Posted August 9, 2011 I made 2 radio buttons for my GUI: 1 to enable the key-swapping function, and the other to "try and disable" the function. This is my first time attempting to do something with radio buttons and as well as working with booleans. I don't know if this is the right way to exit the loop in Case $Radio1 so please suggest a better working way. Case $Radio1 ;enable key swapping ;#cs $input_oldkey = GUICtrlRead($oldkey) ;reads the input under Replace label $upper_oldkey = StringUpper($input_oldkey) ;converts to uppercase to be ready for hex conversion MsgBox(0, "is it upper?", $upper_oldkey) $hex_oldkey = _StringToHex($upper_oldkey) MsgBox(0, "is it hexed?", $hex_oldkey) ;#ce $input_newkey = String(GUICtrlRead($newkey)) ;reads the input under New label, converts to string and passes. $dll = DllOpen("user32.dll") global $power_off = false Do;While 1 If _IsPressed($hex_oldkey, $dll) Then ;MsgBox(0,"_IsPressed", "A Key Pressed") Taking this off allows you to hold down the button and sends $input_newkey repeatedly. WinWaitActive("Ex - Notepad") Send("{" & $input_newkey & "}") ;ExitLoop EndIf Until $power_off = true;$power_off = true;WEnd DllClose($dll) Case $Radio2 ;disables key swapping $power_off = true
wakillon Posted August 9, 2011 Posted August 9, 2011 GUICtrlCreateRadio example in the helpfile can help you to know which radio button is checked in a better way ! AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
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