Sign in to follow this  
Followers 0
Codybean1

How do I make the P key input for .01 seconds as soon as the E Key is Released?

7 posts in this topic

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.  o:)

Share this post


Link to post
Share on other sites



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0