Page 1 of 1
请教一下,如何自动替换 ¥ 字符
Posted: 13 Mar 2021, 22:44
by mikelyou
刚用 autohotkey 不久,还不太会用,在网上搜索无果,所以前来请教各位大佬。非常感谢!
想请问,如何实现将 ¥¥ 字符自动替换为 $$ (用于中英混输时的自动纠错)
下面两个是我仿照示例 ::ftw::Free the whales 写的,但是都没有效果,如果尝试 reload 还会提示 reload失败。
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 14 Mar 2021, 05:10
by garry
Code: Select all
;----------------------
:*:¥¥::
sendinput,{Text}$$
;- OR
:*:¥::$
;----------------------
:*:ftw::Free the whales
;- OR this , ftw then ENTER
::ftw::Free the whales
;----------------------
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 14 Mar 2021, 06:40
by mikelyou
garry wrote: ↑14 Mar 2021, 05:10
Code: Select all
;----------------------
:*:¥¥::
sendinput,{Text}$$
;- OR
:*:¥::$
;----------------------
:*:ftw::Free the whales
;- OR this , ftw then ENTER
::ftw::Free the whales
;----------------------
多谢您的回复!不过我试了一下,没有成功,输入 ¥ 后没有任何反映。我也安装了最新的版本 v1.1.33.06,并没有什么不同。
我猜测可能是 ¥ 符号无法识别?因为我见过的代码中都只有英文字符,不知道是不是这个问题…
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 14 Mar 2021, 07:44
by garry
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 14 Mar 2021, 21:39
by mikelyou
garry wrote: ↑14 Mar 2021, 07:44
sorry , maybe ( ? )
I think the problem is at the first line.
When I change the code to
It works, which will replace a with $. But the script seems don't recognize ¥.
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 14 Mar 2021, 22:09
by fwejifjjwk2
Code: Select all
shift & 4::
{
Sleep, 50
temp := clipboard
clipboard := "$"
ClipWait
Send ^v
clipboard := temp
}
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 14 Mar 2021, 23:09
by sikongshan
按照我的理解,热字串监视的是键盘输入序列,全角的这种¥,类似于汉字,是经过了输入法处理输出的。
像上面这个例子是不能生效的。
具体到你的,可以尝试设置$输出$
我的电脑上只有一个输入法,没有专门的"英文键盘布局",shift进行切换中英文。
上面这个代码,
单独按那个$键盘的时候,不管中英文都输出$。
Re: 请教一下,如何自动替换 ¥ 字符 Topic is solved
Posted: 14 Mar 2021, 23:13
by sikongshan
fwejifjjwk2 wrote: ↑14 Mar 2021, 22:09
用剪貼簿暴力解決
Code: Select all
shift & 4::
{
Sleep, 50
temp := clipboard
clipboard := "$"
ClipWait
Send ^v
clipboard := temp
}
直接接管shift 4 也挺好的
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 15 Mar 2021, 00:02
by mikelyou
非常感谢几位大佬,问题解决啦。
顺便,下面两种代码有什么区别呀?
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 15 Mar 2021, 00:55
by sikongshan
mikelyou wrote: ↑15 Mar 2021, 00:02
非常感谢几位大佬,问题解决啦。
顺便,下面两种代码有什么区别呀?
推荐看那本
《论帮助手册的重要性》
![Laughing :lol:](./images/smilies/icon_lol.gif)
Re: 请教一下,如何自动替换 ¥ 字符
Posted: 15 Mar 2021, 04:36
by garry
當時以為可以用人民幣 ¥
£> $的簡單示例
:*:£::$
:*:ftw::Free the whales > 立即顯示文字
::ftw::Free the whales > 然後按ENTER以顯示文本