rabbitkillrun Posted February 21, 2009 Share Posted February 21, 2009 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... Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 21, 2009 Share Posted February 21, 2009 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 Link to comment Share on other sites More sharing options...
rabbitkillrun Posted February 21, 2009 Author Share Posted February 21, 2009 *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...? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 21, 2009 Share Posted February 21, 2009 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 UDFHotKey Selector window .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
rabbitkillrun Posted February 22, 2009 Author Share Posted February 22, 2009 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... :/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now