Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

ControlSend doesn't send {Enter} to correct control



  • Please log in to reply
6 replies to this topic
radiosilk
  • Members
  • 22 posts
  • Last active: Nov 06 2015 09:10 AM
  • Joined: 27 Sep 2015

In this particular software, ControlSend never sends {Enter} to Button1.

Even tried to use arrow to focus on correct button. Tried to use ControlFocus on Button1.

 

Although, arrow and enter are sent. But Enter never goes to Button1.

 

Can someone please explain why is it that in some programs ControlSend doesn't work ? And how can i make it work ? 

 

Someone pls help.

 

(forum not letting me post a link to uploaded screenshot :S  )

 

 

Had to introduce mouseclick (which worked), but it is not an ideal solution. Script is below, pls have a look. Pls let me know if it can be done differently and how..

 

Many thanks in advance

IfWinExist Nise
ControlFocus,Button1,Nise
Sleep, 200
;ControlSend,Button1,{Enter},Nise
;Sleep,300
SetControlDelay,-1
ControlClick,Button1,Nise,,,,NA


kon
  • Members
  • 1652 posts
  • Last active:
  • Joined: 04 Mar 2013

In this particular software, ControlSend never sends {Enter} to Button1.
Even tried to use arrow to focus on correct button. Tried to use ControlFocus on Button1.

Although, arrow and enter are sent. But Enter never goes to Button1.

Can someone please explain why is it that in some programs ControlSend doesn't work ? And how can i make it work ?

Someone pls help.

(forum not letting me post a link to uploaded screenshot :S )

Many thanks in advance

Maybe the window has a Default button which captures any {Enter} sent to the window?
Have you tried ControlClick?
If that doesn't work, post the code you have tried.

Edit: OP's post seems to have been edited.

Had to introduce mouseclick (which worked), but it is not an ideal solution. Script is below, pls have a look. Pls let me know if it can be done differently and how..

IfWinExist Nise
ControlFocus,Button1,Nise
Sleep, 200
;ControlSend,Button1,{Enter},Nise
;Sleep,300
SetControlDelay,-1
ControlClick,Button1,Nise,,,,NA

That's ControlClick not mouseclick. Why is it not ideal?

To post an image you will need to upload it to an image sharing site like imgur and post a link.



radiosilk
  • Members
  • 22 posts
  • Last active: Nov 06 2015 09:10 AM
  • Joined: 27 Sep 2015

Hi Kon,

 

ControlClick works just fine. As i am new to ahk and coding in general, apprehensive about mouse clicks in macros. You can say that it is lack of my knowledge on how ControlClick works (that it never misses the control mentioned in controlclick command).

 

My keyboard based experience is that i have never seen windows not accepting keyboard commands when operated manually.

 

Somehow, only when macros send keyboard commands then (especially in case of changing focus) such commands sometimes don't execute.

 

The autoit3 spy gave the classnn of controls. THESE CONTROLS ARE RESPONDING TO controlclick BUT NOT TO controlsend.

 

Any ideas why that could be so ?

 

(Lastly, i did upload to imgur and pasted that link in "image" insert but then got error. may be because i am new. i see i can only make 2 more posts until 12oct.)



gilliduck
  • Members
  • 109 posts
  • Last active: Nov 09 2015 01:07 AM
  • Joined: 19 Dec 2013
✓  Best Answer

Try sending a Space to the button if Enter isn't working. As kon said, there might be a default button intercepting the Enter; Space generally has the same effect, but I've found isn't usually intercepted (of course every program is different and this might not be the case).



radiosilk
  • Members
  • 22 posts
  • Last active: Nov 06 2015 09:10 AM
  • Joined: 27 Sep 2015

Thanks a ton, mate ! you made my day !

 

Had been almost 24hrs banging my head on this issue ..

 

space works awesome.....  :D

Try sending a Space to the button if Enter isn't working. As kon said, there might be a default button intercepting the Enter; Space generally has the same effect, but I've found isn't usually intercepted (of course every program is different and this might not be the case).



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Bump.

The last two posts by radiosilk had not been approved, so were probably not visible to ordinary members. I have approved them and radiosilk has been automatically moved out of the "New Members" group.

radiosilk
  • Members
  • 22 posts
  • Last active: Nov 06 2015 09:10 AM
  • Joined: 27 Sep 2015

Thanks, Lexikos.  :shy: