astrax Posted September 24, 2009 Posted September 24, 2009 Hi I need help writing a script to enable/disable hotkeys in a function. I got the first part correct where the checkbox needs to be checked before any hotkeys can activate. But the disabled part i need help with. Here's my example Case $Checkbox If GUICtrlRead($Checkbox) = $GUI_UNCHECKED Then Off() Else On() EndIf Func On() HotKeySet("F1", "Start") EndFunc Func Off() ;disable all hotkeys. EndFunc
AdmiralAlkex Posted September 24, 2009 Posted September 24, 2009 (edited) You should try the helpfile, it won't bite! First you are checking the checkbox the wrong way. As the page for GUICtrlRead() says: For Checkbox, Radio control several states can be returned as $GUI_FOCUS and $GUI_CHECKED,. So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the control is checked. And in the page for HotKeySet(). [optional] The name of the function to call when the key is pressed. Not specifying this parameter will unset a previous hotkey. Edited September 24, 2009 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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