Sign in to follow this  
Followers 0
a_Lexx

Sendkey function only

3 posts in this topic

Good day!

I've tried to use AutoIt scripts in combination with Perl and met the following problem: I've created a small Autoit script with only one SendKey function, which receives command from a command line. I've noticed, that SendKey("{<any key> down}") command works only when autoit script is working, so after the script exists (almost immediately), buttons doesn't remains pressed. Is there any way to keep it pressed, when the scripts has already finished?

Share this post


Link to post
Share on other sites



you would need to loop your script and manually kill it from your perl program. But of course it is better to use autoitX!

Share this post


Link to post
Share on other sites

It seems that you can hook user32.dll in perl, so you should be able to use it's keybd_event to do your keyboard control. Take a look at this:

http://perl.topictracer.com/articles/take_...t_explorer.html

The following code presses A and releases it in AutoIt. You should be able to compare this to the code in my link and see how they're doing the same thing in perl:

$akey = 0x41
$VK_NUMLOCK = 0x90
$KEYEVENTF_KEYUP = 0x02

$dll = DllOpen("user32.dll")
$result = DllCall($dll, "int", "keybd_event", "int", $akey, "int", 0, "int", 0, "ptr", 0)
$result = DllCall($dll, "int", "keybd_event", "int", $akey, "int", 0, "int", $KEYEVENTF_KEYUP, "ptr", 0)
DllClose($dll)

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

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