Sign in to follow this  
Followers 0
happosai

Controlsend problem with {space down}

11 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites

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

Thank you for your reply. So is there another way to hold the space down?

Phil

Share this post


Link to post
Share on other sites

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

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#7 ·  Posted (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" 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

Edited by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites

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

Please 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.

Share this post


Link to post
Share on other sites

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.


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

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