a_Lexx Posted September 5, 2006 Share Posted September 5, 2006 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? Link to comment Share on other sites More sharing options...
ramadash Posted September 5, 2006 Share Posted September 5, 2006 you would need to loop your script and manually kill it from your perl program. But of course it is better to use autoitX! Link to comment Share on other sites More sharing options...
lod3n Posted September 5, 2006 Share Posted September 5, 2006 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.htmlThe 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] 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