Sign in to follow this  
Followers 0
rabbitkillrun

Check if GUI control is active

5 posts in this topic

I am trying to make my program user friendly by having an input box that, when it has been clicked in, will capture the keys pressed. Similar to how many other programs do, when you click in the box and then press, say, Ctrl+Alt+K, it will turn the text box into this, and if you take your finger off Alt, it will change to Ctrl+K. I've been searching the forum, and i found that i should probably use the IsPressed function, although i can see this being quite a long piece of code. However, i don't know how to find out when/if the textbox is selected. Is there a blindingly obvious way to do this that i've stupidly missed, or is this something difficult to do? I already have a function that will convert strings with keys stored in the form that the Send() function uses to user-friendly language, incase anyone knows a better way than IsPressed().

Thanks, and sorry if this is obvious and/or has been asked before...

Share this post


Link to post
Share on other sites



However, i don't know how to find out when/if the textbox is selected...

ControlGetFocus()

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

*feels stupid*

when i couldn't find anything in search, i looked through the commands that start "GUICtrl..." and then "GUI..."... never thought of looking for something that wasn't autoit gui specific...

one thing though... i'm using an onEvent GUI, so would i have to do this in my empty while loop at the top and constantly poll the GUI...? The GUI won't be open for most, if not all, off the time the program is running, so this seems like a slight waste of CPU time... Any ideas...?

Share this post


Link to post
Share on other sites

There are already a couple of scripts in the example scripts forum that do things like this, maybe they can help you.

Hotkey Inputboxes

_ChooseHotKey UDF

HotKey Selector window

Share this post


Link to post
Share on other sites

Hey,

thanks for the reply. Those do look useful, but i can't understand them well enough to change them and put them into my own script, and i don't want to have to include it and change the look/workings of my script.

I guess i'll just keep it the way it is... :/

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