Orange9 Posted October 7, 2006 Share Posted October 7, 2006 Er...i dont know how to hold down a certain key on the keyboard. I've read the help function n it gave me various commands for it, but the parameters dont make sense. For example the Opt("SendKeyDownDelay", x) where x is the number of milliseconds. Well, it requires me to input the amount of time to hold the key for, which is great, but where do i input the actual key that it presses? For example if i wanted to hold down the key "a", where do i put that? Link to comment Share on other sites More sharing options...
this-is-me Posted October 7, 2006 Share Posted October 7, 2006 You know, the help file is a lot more helpful than you may think.To hold a key down (generally only useful for games) Send("{a down}") ;Holds the A key down Send("{a up}") ;Releases the A key Who else would I be? Link to comment Share on other sites More sharing options...
Orange9 Posted October 7, 2006 Author Share Posted October 7, 2006 Yes, i know, i've read that too. But the problem with THIS command is that it doesnt ask u how long to hold that particular key for. Link to comment Share on other sites More sharing options...
martin Posted October 7, 2006 Share Posted October 7, 2006 Opt("SendKeyDownDelay", 1000);set subesquent keys to be held down for 1000ms send("a");key a is held down for 1000ms then released . . . Opt("SendKeyDownDelay", 10);keys will be held down for 10 ms from now on Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Helge Posted October 7, 2006 Share Posted October 7, 2006 Opt is an alias for AutoItSetOption, which is function that is used to configure how some parts of AutoIt works. It doesn't do any action in itself. When using Opt with "SendKeyDownDelay" you set how long the release-delay for Send should be, for example when you send "a". However when you use Send like this-is-me showed, sending "{a down}", I believe it's up to the scripter to manually release it, by sending "{a up}". So, what do you want ? Do you want the script to just send "a" and then continue, or do you want the script to hold down "a", do some stuff and then release "a" again ? Link to comment Share on other sites More sharing options...
Orange9 Posted October 7, 2006 Author Share Posted October 7, 2006 Cool. But it doesnt seem to work for me. When i open notepad, if i hold down the button, lets say "a", it supposed to keep repeating "a"s on the notepad until i release the "a" button right? but it doesnt >< Link to comment Share on other sites More sharing options...
dandymcgee Posted October 8, 2006 Share Posted October 8, 2006 (edited) You really need to be more specific of what you want. If you just need to hold down a key then Send("{a down}") Sleep("INPUT TIME") Send("{a up}") Please explain exactly what you expect the "a" key to do. Edited October 8, 2006 by dandymcgee - Dan [Website] 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