Jump to content

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

Sending a <ctrl> click


  • Please log in to reply
3 replies to this topic
Alan Stancliff
  • Members
  • 58 posts
  • Last active: Nov 18 2019 09:25 AM
  • Joined: 25 Mar 2007
I am trying to create a script that I can use when typing in Word. What I want it to do is put down a marker composed of this: //\\. Then I want it to back up to the previous sentence. Then I want it to select that sentence by sending a <ctrl><click>. The <ctrl><click> combination selects the entire sentence that the cursor is resting in. The hotkey I have for it is <ctrl><alt><down arrow>

Here is what I have come up with:
^!down::
sendinput //\\{CTRLDOWN}{LEFT}{LEFT}{CTRLUP}
^{click}
return
This seems to fall apart at the sending of the mouseclick. Does anybody have any suggestions?
Regards,

Alan Stancliff
My Web Site

trik
  • Members
  • 1317 posts
  • Last active: Jun 11 2010 11:48 PM
  • Joined: 15 Jul 2007
Try
Send, {Ctrl Down}{Click}{Ctrl up}

Religion is false. >_>

tonne
  • Members
  • 1654 posts
  • Last active: May 06 2014 06:22 PM
  • Joined: 06 Jun 2006
Maybe you need this:

; use this at the start of the script to wait for release (as ctrl-alt down interferes)
  KeyWait, Control
  KeyWait, Alt
  ...
; make sure the caret and the mouse use same coordinates
  coordmode,caret,screen
  coordmode,mouse,screen
; simulate control click at caret
  Send, {Control down}
  MouseClick, left, %A_CaretX%, %A_CaretY%
  Send, {Control up}


Alan Stancliff
  • Members
  • 58 posts
  • Last active: Nov 18 2019 09:25 AM
  • Joined: 25 Mar 2007

Maybe you need this:

; use this at the start of the script to wait for release (as ctrl-alt down interferes)
  KeyWait, Control
  KeyWait, Alt
  ...
; make sure the caret and the mouse use same coordinates
  coordmode,caret,screen
  coordmode,mouse,screen
; simulate control click at caret
  Send, {Control down}
  MouseClick, left, %A_CaretX%, %A_CaretY%
  Send, {Control up}


Thanks, Tonne,

Once again, you have come to my rescue. That works perfectly. Thanks for your careful explanation.

Regards,

Alan
Regards,

Alan Stancliff
My Web Site