Jump to content
Sign in to follow this  

on/off toggle with checkbox to disable/enable hotkeyset help

Recommended Posts



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

Func On()

HotKeySet("F1", "Start")


Func Off()

;disable all hotkeys. 


Share this post

Link to post
Share on other sites

You should try the helpfile, it won't bite! :D

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 by AdmiralAlkex

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this