我是自动热键的初学者。
我想要制作脚本来检查我是否写了“:)”,然后它替换为这个“”(web.whatsapp 中的表情符号)我不知道是否可以使用 GetKeyState 因为在我的键盘中我需要 Shift+dot 来表示“: " 和 ")" 的 Shift+9。
我很抱歉我的英语不好。希望你能理解。:)
谢谢你。
有效的代码(感谢 Forivin)
:::)::
clipSave := ClipboardAll
Clipboard := "" ;
Send, ^v
Clipboard := clipSave
Return
:::D::
clipSave := ClipboardAll
Clipboard := "" ;
Send, ^v
Clipboard := clipSave
Return
Run Code Online (Sandbox Code Playgroud)
这对我有用:
:::)::
clipSave := ClipboardAll
Clipboard := "" ;make sure this actually contains the smiley character, once you copied that into your notepad application
Send, ^v
Clipboard := clipSave
Return
:::(::
clipSave := ClipboardAll
Clipboard := "" ;make sure this actually contains the smiley character, once you copied that into your notepad application
Send, ^v
Clipboard := clipSave
Return
Run Code Online (Sandbox Code Playgroud)
确保使用正确的编码保存文件(UTF-8 为我完成了这项工作)。您可能想为此使用 Notepad++ 之类的东西。
安装 unicode 版本的 Autohotkey 也可能有帮助。(我使用最新的 32 位 Unicode 版本的 AHK_L。)