Codybean1 Posted January 24, 2014 Posted January 24, 2014 I just want a simple script that makes it so that when I press the E Key and let it go, the P Key is imputed for a brief period of time. Thank you in advance.
water Posted January 24, 2014 Posted January 24, 2014 Welcome to AutoIt and the forum! Can you please tell us what you try to achieve? Which program do you try to automate? 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
Codybean1 Posted January 24, 2014 Author Posted January 24, 2014 I'm trying to automate an emulation software known as Dolphin. I'm trying to create some interesting Key Bindings to make things easier to control but the Program only goes so far. I need a timed input whenever the 'E' key is released that inputs the 'P' key for a brief period of time, then resets for the next time the 'E' key is released. So when I let go of E, P is input for a short period of time. That's pretty much it.
water Posted January 24, 2014 Posted January 24, 2014 (edited) Something like this? Every time you press "E" one "P" is being sent to the active window. HotKeySet("E", "_PKey") HotKeySet("{ESC}", "_Exit") ; End the script While 1 Sleep(50) WEnd Func _PKey() Send("P") EndFunc ;==>_PKey Func _Exit() Exit EndFunc ;==>_Exit Edited January 24, 2014 by water 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
Codybean1 Posted January 24, 2014 Author Posted January 24, 2014 So I got it to work, but I'd like it so whenever E is not being pressed would P trigger for a short period of time, and not forever. Again, thank you so far.
water Posted January 24, 2014 Posted January 24, 2014 Sorry, but I don't get it. The script should wait until you press and release "E", then it should send "P" for 0.01 seconds? How many "P" do you expect to be sent is this short time? 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
JohnOne Posted January 24, 2014 Posted January 24, 2014 Look at _IsPressed function. Learn how to use a while loop and If...Then condition. That's all you need. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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