Sign in to follow this  
Followers 0
Garrett19212

Controlclick, Controlsend

9 posts in this topic

I have been usin Controlsend throughout my program, but it doesn't work for sending ctrl a.

ControlSend("Warcraft III", "", "", "!{A}")

Thats the code that doesn't work.

I use other things like ctrl c, ctrl g etc and they all work fine but ctrl a doesn't.

So I tried controlclick, but I can't seem to figure out how to make it click a position of the screen, not a control.

Share this post


Link to post
Share on other sites



ControlSend("Warcraft III", "", "", "!{A}")
So I tried controlclick, but I can't seem to figure out how to make it click a position of the screen, not a control.
Use "^a" to send Control+a.

Use MouseClick() to click a screen position.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

Sorry i meant alt a.

And I need it to click a spot on another window, not on a position on the screen your currently viewing.

Share this post


Link to post
Share on other sites

Though I've heard others mention it, I've never had any luck using ControlSend without specifying a control (empty quotes). Is this usage even supported?

Without a control, I would just use Send:

Opt ("WinTitleMatchMode", 4)
  $hCur = WinGetHandle("active")
  WinActivate("Warcraft III")
  Send("!a")
  WinActivate($hCur)
Do any controls show up in AU3Info?

And I need it to click a spot on another window, not on a position on the screen your currently viewing.

MouseClick can be used to click either a window or screen position. Look at the help file entry for AutoItSetOption - MouseCoordMode.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thats one of the reasons i'm using control send, I don't want the window to be maximized.

(its for a game)

And no controls show up.

Edited by Garrett19212

Share this post


Link to post
Share on other sites

And no controls show up.

I'm assuming you're using Au3Info to look for the controls...

What is the output of this function?

MsgBox(0, "Classes", WinGetClassList("Warcraft III", ""))

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

Nothing.

Share this post


Link to post
Share on other sites

bump

Share this post


Link to post
Share on other sites

Nothing.

AFAIK, ControlSend won't work without a target control.

These test were done with an empty notepad window open...

Running this code from SciTE sends Alt+F to SciTE.

$WinTitle = "Untitled - Notepad"
  ControlSend($WinTitle, "", "", "!f")
Activating Notepad first sends the keys to notepad.

$WinTitle = "Untitled - Notepad"
  WinActivate($Wintitle) 
 ControlSend($WinTitle, "", "", "!f")
So, it looks like ControlSend sends keys to the active window if no control is specified.

Instead of running the game minimized, what about hiding the window?

This would allow you to activate it and interact with it without ever seeing it.

If I have time, I may dig up and dust off the ol' cd...

Remind me again what "Alt+A" would accomplish in-game?


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/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