Jump to content

Controlclick, Controlsend


Recommended Posts

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.

Link to comment
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]

Link to comment
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]

Link to comment
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]

Link to comment
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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...