Oblivious Posted January 2, 2018 Posted January 2, 2018 I'm a bit new to this whole scripting thing so I'm sorry if this is fairly simple to many of you. I was looking at the AutoIt FAQ on the wiki page and I saw the example given which was: #include <Misc.au3> $pressed = 0 While 1 If _IsPressed("4B") Then If Not $pressed Then ToolTip("K Key being held down") MouseDown("left") $pressed = 1 EndIf Else If $pressed Then ToolTip("") MouseUp("left") $pressed = 0 EndIf EndIf Sleep(250) WEnd But after looking at this, I was wondering how I could make a script where by holding down 'e', it would first press 'e' once, hold down 'a' and 's' for 100 ms then release them, then finally press left Alt. The keystrokes would then be repeated for as long as the 'e' key is held down, so if it was released, it would stop repeating the process ('e' -> hold down 'a' and 's' for 100 ms then release both -> press left Alt -> repeat). I apologize if this is in the wrong section and if this is simple to many of you, I hope that I can use the information given by you all to good use. Your help is greatly appreciated!
water Posted January 2, 2018 Posted January 2, 2018 Welcome to AutoIt and the forum! Which application do you try to automate? Sending keys is not very reliable because keys always get sent to the active window, the user might interfere with your script etc. etc. If we know what you try to achieve we can try to suggest a reliable solution My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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