带有编码文本的自动热键

Auto Hot Keys with coding text

我想做一个自动热键脚本来粘贴:

{ get; set; }

对于 C#

这是可能的还是它不知道如何处理空格,{, ;?

我尝试了以下方法,但它不起作用:

    ^NumPad3::
    SendInput, { get; set; }
    return

逗号、分号和其他字符(例如 {}^!+#)在 AHK 中具有特殊含义,需要进行转义才能以不同于正常情况的方式进行解释。

F1:: SendInput, {{} get`; set`; {}}

https://autohotkey.com/docs/commands/_EscapeChar.htm#Escape_Sequences

发送此类文本的最简单方法是

F2::
Send {Raw}  
(
{ get; set; }
)
return

F3::
Send {Blind}{Text} ; [v1.1.27+] 
(
{ get; set; }
)
return

https://autohotkey.com/docs/commands/Send.htm