Guest angelcat Posted September 23, 2004 Posted September 23, 2004 Hello all, this is my first post and I have a feeling it's probably a silly questionI am trying to write a simple script to hold down the Spacebar - (the applet Iam trying to partly automate uses this to present an alternative display which revertsto its standard one when the Spacebar is released)I have tried the following:-Send("{SPACE} down")Sleep(3000)Send("{SPACE} up}")and fed it to a TextPad window with the followingresult where I have substituted dots to representvisible spaces for clarity..down..upAnd the applet behaves as though it were gettingexactly the same inputI have also tried several different approaches includingusing a variable $S to hold " " with no successhaving scoured past posts for a clue I am beginning to feel Iam up against an intractable problem But would be happy to have my mistake pointed out! angelcat
Administrators Jon Posted September 23, 2004 Administrators Posted September 23, 2004 Send("{SPACE down}")
Guest angelcat Posted September 23, 2004 Posted September 23, 2004 Send("{SPACE down}") <{POST_SNAPBACK}>Thank you Jon for that prompt reply - I have tested it (with nice chunks of Sleep between characters) and the results are curious In TextPad {SPACE down} gives a space {SPACE up} does nothing In the target applet {SPACE down} does nothng {SPACE up} gives a space Clearly the two programs organise themselves differently in the processing of keystrokes and it looks like the applet is detecting the keydown condition in some manner which is not 'fooled' by the {SPACE down} It may be back to the drawing board for me! angelcat
Guest angelcat Posted September 23, 2004 Posted September 23, 2004 I finally worked it out!! If I script:- Send("{SPACE down}");does nothing Send("{SPACE down}");triggers the display effect! The applet is imputing a different meaning to "Space held down" than to "Space pressed and released" - so I guesss it's waiting for the second SpaceDown condition to occur It does it fine now - thanks - It's so much easier to figure these things when you KNOW your syntax s OK Thanks a bunch, Jon angelcat
emmanuel Posted September 23, 2004 Posted September 23, 2004 maybe you want to try playing with Opt("sendkeydowndelay",X) to see if that helps. I finally worked it out!! If I script:- Send("{SPACE down}");does nothing Send("{SPACE down}");triggers the display effect! The applet is imputing a different meaning to "Space held down" than to "Space pressed and released" - so I guesss it's waiting for the second SpaceDown condition to occur It does it fine now - thanks - It's so much easier to figure these things when you KNOW your syntax s OK Thanks a bunch, Jon angelcat <{POST_SNAPBACK}> "I'm not even supposed to be here today!" -Dante (Hicks)
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