happosai Posted October 8, 2008 Share Posted October 8, 2008 Hi, i have a script that sends keystrokes to a minimized application. However, every keys from A to Z works perfectly even the controlclick works. So what's the problem with space down and space up? I'm aware that Send("{space down}") works but for active window only. Thanks, Phil Link to comment Share on other sites More sharing options...
ken82m Posted October 8, 2008 Share Posted October 8, 2008 (edited) Their is no {space down}/{space up} just {space} The UP/DOWN functionality only exists for ALT/CTL/SHIFT/WINKEY. Since they are the only ones used in conjunction with other keys. Kenny Edited October 8, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
happosai Posted October 8, 2008 Author Share Posted October 8, 2008 Their is no {space down}/{space up} just {space}The UP/DOWN functionality only exists for ALT/CTL/SHIFT/WINKEY.Since they are the only ones used in conjunction with other keys.KennyThank you for your reply. So is there another way to hold the space down?Phil Link to comment Share on other sites More sharing options...
ken82m Posted October 8, 2008 Share Posted October 8, 2008 (edited) If that's all you want to do you could create a loop. This would contiously loop sending the space over and over, effectivly holding it down. While 1 Send("{Space}") Sleep(100) Wend Does that help you? I mean that is what your keyboard does anyway, if you hold it down if has a repeat delay that keeps sending the key over and over. If not post a little more info on what your trying to do. Thanks, Kenny Edited October 8, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
happosai Posted October 8, 2008 Author Share Posted October 8, 2008 If that's all you want to do you could create a loop. This would contiously loop sending the space over and over, effectivly holding it down. While 1 Send("{Space}") Sleep(100) Wend Does that help you? I mean that is what your keyboard does anyway, if you hold it down if has a repeat delay that keeps sending the key over and over. If not post a little more info on what your trying to do. Thanks, Kenny So i guess i can set up a loop for 2 second that's like holding the space down for 2 second? Good idea thanks alot! Link to comment Share on other sites More sharing options...
happosai Posted October 8, 2008 Author Share Posted October 8, 2008 Sorry! But controlsend($app_title, "", "", "{space}") doesn't work as well! i dont know what did i do wrong but all other keys are working. Phil Link to comment Share on other sites More sharing options...
ken82m Posted October 8, 2008 Share Posted October 8, 2008 (edited) The Send command just sends to whatever is active.With that command you need to specify the window and control you are sending to.You are missing the control info, being something to identify what on the window you are sending to.Here's an example that would send a space to my notepad windows text area:ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "{space}")To get the Control Info:1) On your start menu run "AutoIt Window Info" in your AutoIT Group.2) Click on the "Control" tab3) Hit CTL+ALT+F to freeze the tool4) Drag the "Cross Hairs" over to the area you are sending the space to.5) Double click on the "Advanced (Class)" line, that will copy the info to your clipboard.That is the control info for your command, so just paste it into your code and you should be all set.Kenny Edited October 8, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
happosai Posted October 8, 2008 Author Share Posted October 8, 2008 The Send command just sends to whatever is active. With that command you need to specify the window and control you are sending to. You are missing the control info, being something to identify what on the window you are sending to. Here's an example that would send a space to my notepad windows text area: ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "{space}") To get the Control Info: 1) On your start menu run "AutoIt Window Info" in your AutoIT Group. 2) Click on the "Control" tab 3) Hit CTL+ALT+F to freeze the tool 4) Drag the "Cross Hairs" over to the area you are sending the space to. 5) Double click on the "Advanced (Class)" line, that will copy the info to your clipboard. That is the control info for your command, so just paste it into your code and you should be all set. Kenny Hmm, weird but the game i want doesn't have advanced(class) or anything except Handle: 0x00C60518. As you may already know that all other keys work except space and up keys. In SEND command they both work for the active window. Phil Link to comment Share on other sites More sharing options...
ken82m Posted October 8, 2008 Share Posted October 8, 2008 (edited) ahh it's a game - I know that can be a challenge, I've seen some other posts. I'm not sure what to do with that one, never used it with games myself. I have read about how they can process some things like holding down keys can be different that other applications. You might want to submit another post and mention specifically that it's a game. Make the subject "ControlSend not working for game" or something like that. Sorry I couldn't help more. Kenny Edited October 8, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 8, 2008 Moderators Share Posted October 8, 2008 ahh it's a game - I know that can be a challenge, I've seen some other posts.I'm not sure what to do with that one, never used it with games myself.I have read about how they can process some things like holding down keyscan be different that other applications.You might want to submit another post and mention specifically that it's a game.Make the subject "ControlSend not working for game" or something like that.Sorry I couldn't help more.KennyPlease don't encourage people to create multiple topics.They can edit their topics to suit their needs.@OP - Try leaving the control id parameter blank. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ken82m Posted October 8, 2008 Share Posted October 8, 2008 He tried that. But sorry, edited posts before but didn't know you could actually change the title of a thread after it's been replied to. "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." 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