rootx

HotKeySet help [SOLVED]

3 posts in this topic

#1 ·  Posted (edited)

When the TAB key is pressed, I wish it was as if I had pressed the button1 in the gui. I have no idea..... THX

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 216, 168, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

HotKeySet("{TAB}", $Button1)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox("","test","test")
    EndSwitch
WEnd

 

Edited by rootx

Share this post


Link to post
Share on other sites



check GUISetAccelerators in help file.

 

Saludos

1 person likes this

Share this post


Link to post
Share on other sites

OK... I leave it for others...

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 216, 168, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Local $AccelKeys[1][2] = [["{TAB}", $Button1]]
GUISetAccelerators($AccelKeys)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            MsgBox("","test","test")
    EndSwitch
WEnd

 

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