Jump to content

Recommended Posts

Posted (edited)

Heya, ime stuggling abit to make my ControlSend send Both Shift and F1 at once.

These things iwe tried:

ControlSend("win","","","+{F1}")
;------------------------------------------

ControlSend("win","","","{SHIFTDOWN}{F1}")
ControlSend("win","","","{SHIFTUP}")
;------------------------------------------

ControlSend("win","","","{SHIFTDOWN}")
ControlSend("win","","","{F1}")
ControlSend("win","","","{SHIFTUP}")
;------------------------------------------

oh, i tried with both send flags (0/1).

As a sidenote, if i activate the window then use:

WinActivate("win","")
Sleep(100)
Send("+{F1}")

That works, but having to activate the window means the process will interfere with other thing's as im trying to automate this task.

Any ideas?

Edited by jokke
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Posted

The first example should work. But what you are missing is the ControlId.

ControlSend("win","",ControlId,"+{F1}")

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

Theres no control, thats why its blank :)

Well i am sending single keys just fine, but once i start mixing up more keystrokes at once it just wont send em.

ControlSend("win","","","+{F1}") Results sending F1 but not the Shift.

As i worte as a side note, when i activate the window and use Send it works.

Edited by jokke
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Posted (edited)

See Remarks of ControlSend: " ...works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active window."

To send key strokes to an active window use Send. To send key strokes to an inactive window use ControlSend and specify a ControlId.

So I think what you want (send key strokes to an inactive window) can't be done.

For further info please see this post.

Edited by water

My UDFs and Tutorials:

  Reveal hidden contents

 

  • 14 years later...
Posted

Can someone explain why

ControlSend("win","","","+{F1}")

doesn't work

whereas

ControlSend("win","","","{F1}")
Send("+{F1}")
Send("{F1}")

works well?

 

The discussion here resulted in the statement that you need a ControlID, but didn't answer all questions.

So in other words:

Why does a missing ControlID block using modifiers like "+" etc? What's the actual reason? May it be application dependend?

Of course there's always a workaround but it's nicer to have a straightforward way.

Posted (edited)

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
  • Recently Browsing   0 members

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