如何在AutoHotKey片段中指定光标位置?

时间:2018-12-29 16:17:24

标签: autohotkey

如何在AutoHotKey代码段中指定(更新:键盘)光标位置?例如:

::hkr::    
Send,    
(    
Hello,    

__cursorhere()    

Kind regards,    
Constantine    
)    
return

1 个答案:

答案 0 :(得分:1)

::hkr::
SendInput,
(
Hello,



Kind regards,
Constantine
)
Send {Up 3} ; move the keyboard cursor at the middle of the text.
return

另一个例子:

::hkr::
SendInput,
(
Hello,

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. CARET_HERE It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum

Kind regards,
Constantine
)
Send {Up 2}{Ctrl Down}{Left 34}{Ctrl Up} ; move the keyboard cursor before the word "CARET_HERE".
return