Sign in to follow this  
Followers 0
ksmith247

Make inputbox active

8 posts in this topic

Is there a way to have a key combination to send focus to an input box, like the way ctrl + d will do in Firefox or IE?


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites



I tried using ControlFocus (making it a variable) and then using HotKeySet but that didn't work.

Anyone know the actual way to do this?


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites

Please post the contents of the summary tab within the AutoIt Window Info tool for the control of interest.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Please post the contents of the summary tab within the AutoIt Window Info tool for the control of interest.

Here it is, sir...

>>>> Window <<<<

Title: Run Remote Apps

Class: AutoIt v3 GUI

Position: 488, 325

Size: 308, 352

Style: 0x14CF0000

ExStyle: 0x00000100

>>>> Control <<<<

Class: Edit

Instance: 1

ID: 3

Text:

Position: 562, 388

Size: 150, 30

ControlClick Coords: 72, 16

Style: 0x50030080

ExStyle: 0x00000200

>>>> Mouse <<<<

Position: 634, 404

Cursor ID: 5

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Remote Computer

E&xplorer

&CMD

&Regedit

MSCONFI&G

Install &VNC

&MMC Console

Start V&NC

"C&ombined"

&Kill AutoLogon

Install RCM&D

&PC Info

&Set AutoLogon


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites

Well, that confirms that we are talking about am AutoIt GUI and not some other app's input box - I could not tell from your OP.

I know nothing about AutoIt GUIs, but a search of the help file for the word focus did return $GUI_FOCUS - I have no idea if this is what you want/need.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

maybe you could use _ispressed

Share this post


Link to post
Share on other sites

Like this maybe ?

#include <GUIConstants.au3>

HotKeySet('!f', 'Focus')
Global $State

GuiCreate('Focus', 220, 65)
$Input1 = GuiCtrlCreateInput('Alt + F to set focus to other input box', 10, 10, 200, 20)
$Input2 = GuiCtrlCreateInput('Alt + F to set focus to other input box', 10, 35, 200, 20)
GuiSetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
            
    EndSelect
WEnd

Func Focus()

    If $State = 0 Then
        GUICtrlSetState($Input2, $GUI_FOCUS)
        $State = 1
    ElseIf $State = 1 Then
        GUICtrlSetState($Input1, $GUI_FOCUS)
        $State = 0
    EndIf   
EndFunc

Cheers

Share this post


Link to post
Share on other sites

Thanks for the replies.

@smashly - I was using $GUI_FOCUS incorrectly. Thank you.


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

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
Sign in to follow this  
Followers 0