rickd Posted June 17, 2007 Share Posted June 17, 2007 Hi, I have a script that I would like to be able to be able to control with key presses, eg. so if the key "a" is pressed while my script is running then the script would do something. How do I do this? And also one other quick question, is it possible to start a gui with one of the buttons already selected (highlighted, or in focus, not sure what the proper term is)? Thanks. Link to comment Share on other sites More sharing options...
BrettF Posted June 17, 2007 Share Posted June 17, 2007 HotKeySet () will do you job. of the _IfPressed () UDF ControlFocus () will probably work Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
James Posted June 17, 2007 Share Posted June 17, 2007 #include <Misc.au3> $Dll = DllOpen("user32.dll") If _IsPressed("11", $DLL) Then MsgBox(0, "You Pressed", "You pressed CTRL!") EndIf Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
rickd Posted June 17, 2007 Author Share Posted June 17, 2007 I have another related question I thought would be ok to ask here as well; I am using labels with background colours as buttons (eg label with blue background with while text as my button), they work well but it is not possible to tell when one of them is in focus. Is there a way for the label to respond to being infoucs? Could I make it change text or background colour? (possible using a udf if functionality not built in?) A mouse is not used with my UI, so I'm not meaning on mouseover events, just when the button is tabbed to etc it could do something... Link to comment Share on other sites More sharing options...
Generator Posted June 17, 2007 Share Posted June 17, 2007 I have another related question I thought would be ok to ask here as well; I am using labels with background colours as buttons (eg label with blue background with while text as my button), they work well but it is not possible to tell when one of them is in focus.Is there a way for the label to respond to being infoucs? Could I make it change text or background colour? (possible using a udf if functionality not built in?)A mouse is not used with my UI, so I'm not meaning on mouseover events, just when the button is tabbed to etc it could do something...Why not use button? Any adventage of using a label button? Link to comment Share on other sites More sharing options...
rickd Posted June 17, 2007 Author Share Posted June 17, 2007 Why not use button? Any adventage of using a label button?The UI I have made is for my HTPC, it's just runs on startup and lets my launch applications, standard windows buttons don't look as good as the labels and not as clear to see on the TV. Only problem I have is I don't know which label (button) is currently selected at the moment. Link to comment Share on other sites More sharing options...
Generator Posted June 17, 2007 Share Posted June 17, 2007 The UI I have made is for my HTPC, it's just runs on startup and lets my launch applications, standard windows buttons don't look as good as the labels and not as clear to see on the TV. Only problem I have is I don't know which label (button) is currently selected at the moment.I remember there is an option that you can set the label/button have a boarder(thin or thick your choice).Just look through help file. 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