Jump to content

Press Enter on a GUI


Recommended Posts

In a GUI with input controls and a button type "OK", if I modify the data into a control and then click on the button, the GUIGetMsg() generate a event for the control modified (where is possible to make some tests) and then the event for the button (for example, exit out the cicle).

If I press Enter and have defined a default action type "GUICtrlSetState($BottOK, $GUI_DEFBUTTON)", directly exit out the cicle, without generate the event for the modifies controls.

The first action is the right for the same situation realized, with mouse or keyboard.

Best regards, Giuseppe.

Link to comment
Share on other sites

I did not get it either. You want to exit the application without trigging an event from the gui item you have clicked?

A code sample would probably be clarifying. :D

Link to comment
Share on other sites

You might be better removing the $DEFBUTTON, and instead use a HotKey for the {enter} action, something like...

HotKeySet("{Enter}" , "EnterExitCicle")

; ...

; Enter to exit cicle..
func EnterExitCicle()
    if WinActive($gui) then
        ExitCicle() ; replace with your own exit-cicle function name
    else
        HotKeySet("{Enter}")
        Send("{Enter}")
        HotKeySet("{Enter}" , "EnterExitCicle")
    endif
endfunc

but then, perhaps I misunderstood the question.

-mu

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