Jump to content

Recommended Posts

Posted

I have got a feeling I am being really thick here.. :lmao:

I have a gui with an input box - eg "type PC name in here...blah..blah"

Whilst my fingers are on the keyboard - I would like to hit the 'ENTER' key to take some action. I have configured a button to do this - but it can't be in focus whilst I am typing in the input box.

I would quite like the input box in my GUI to act in a similar way to a 'Windows' input box - you can just hit 'ENTER' to action the input box - you do not need to click something with a mouse.

Can I configure the GUI to do this. ?

Thanks

  • Administrators
Posted

I have got a feeling I am being really thick here..    :lmao:

I have a gui with an input box - eg "type PC name in here...blah..blah"

Whilst my fingers are on the keyboard  - I would like to hit the 'ENTER' key to take some action. I have configured a button to do this - but it can't be in focus whilst I am typing in the input box.

I would quite like the input box in my GUI to act in a similar way to a 'Windows' input box - you can just hit 'ENTER' to action the input box - you do not need to click something with a mouse.

Can I configure the GUI to do this.  ?

Thanks

Yeah, you need to set a button as "default". Use GUICtrlSetState with the $GUI_DEFBUTTON state. The button should then have a slightly darker highlight to show that when you press enter it will be the default.


 

Posted

Thanks - I had looked at the state table list for ages - and I suppose I didn't really know what was meant by "Control will be set as the default button on the window" - so I never tried it !! ...but now I know.

Many thanks.

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
  • Recently Browsing   0 members

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