Jump to content

Hotkey-Settings


Recommended Posts

You dont need to download the Script. I will show it here:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 406, 308, 261, 200)
$testbox = GUICtrlCreateCheckbox("Testbox", 136, 104, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

HotKeySet("c", "_Config")
HotKeySet("{ESC}", "_Beenden")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func _Config()
    If GUICtrlRead($testbox) = 1 Then
        MsgBox($MB_SYSTEMMODAL, "Title", "The Checkbox is active.", 3)

    Else
        Send ("c")
        EndIf
EndFunc

Func _Beenden()
    Exit
EndFunc

 

Edited by Jos
added codebox
Link to comment
Share on other sites

  • Developers

what exactly is not working? 
I guess you do have to disable the hotkey before sending the actual character like:

Func _Config()
    If GUICtrlRead($testbox) = 1 Then
        MsgBox($MB_SYSTEMMODAL, "Title", "The Checkbox is active.", 3)

    Else
        HotKeySet("c")
        Send ("c")
        HotKeySet("c", "_Config")
    EndIf
EndFunc

Jos

Ps: Using codeboxes is a little easier to read. ;)  

Edited by Jos

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.
  :)

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum, as the Dev forum very clearly states:

Quote

Do not create AutoIt-related topics here, use AutoIt General Help and Support

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...