Jump to content

Type info into INPUT box - then hit enter


steve8tch
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Administrators

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