我在公司电脑上用微软五笔,现在想用hotstring来解决数字后的句号换成小数点的问题,理论上应该可行?我只需要把10个数字的场景都写一次就行。
但我写了如下的脚本上根本没有用,不知道为什么 。
::1。::1.
:*:1。::1.
大家有任何主意的吗?
谢谢。
Hotstring问题 Topic is solved
Moderators: tmplinshi, arcticir
Hotstring问题
Last edited by amwihgu on 30 Aug 2023, 01:28, edited 1 time in total.
-
- Posts: 4
- Joined: 23 Aug 2023, 01:17
Re: Hotstring问题
没看到代码哎
Re: Hotstring问题
抱歉。我发太快了,忘了粘贴。现在贴上了。
(还在审核,我这里也粘贴一下:)
:*:1。::1.
::1。::1.
(还在审核,我这里也粘贴一下:)
:*:1。::1.
::1。::1.
Re: Hotstring问题
。是按 . 出來的,所以要用 . 而不是。
而 :: 後面的 1. 在預設狀態下還是按下 1.,所以要使用 T 選項讓 :: 後面的一切按照字面上的字符輸入,而不是根據鍵盤位置輸入。
Code: Select all
:*T:1.::1.
Code: Select all
#Requires AutoHotkey v2
Loop 10
Hotstring ":*T:" (Key := A_Index - 1) ".", key "."
Dark Theme for Everything
Other Scripts
- Dark Theme MsgBox & InputBox
- Dark Theme ListView Control
- ToolTip with System Theme Awareness
- Dark Theme WindowSpy
Other Scripts
- Customize Gui Button Color
- SetWindowColor.ahk - Customise the Colour of the Title Bar and Border.
- KeyboardLayout.ahk - Switching between Keyboard Layouts
- MouseHook.ahk - Tool for Intercepting Mouse Events
- ToolTipEx.ahk - Extension for Custom Tooltips
Re: Hotstring问题
非常感谢!我本意是以为hotstring能识别到我的输出值然后替换掉,所以它还是只能响应keystroke,明白了。
确实可以用,我读下来其实没有完全懂,但是保证会去研究这个T选项。
现在产生了一个新的问题,虽然不解决也问题不大,但是为了学习了严谨想继续请教:
有少数场合1后面还是可能会是用中文名号,比如一个中文句式中说「最终值为1。」
我在想,是不是有一个可能,在连1.的时候出来1.但我一旦在1.后再输入一个. (即1..),则又能还原成1。呢?
谢谢。
确实可以用,我读下来其实没有完全懂,但是保证会去研究这个T选项。
现在产生了一个新的问题,虽然不解决也问题不大,但是为了学习了严谨想继续请教:
有少数场合1后面还是可能会是用中文名号,比如一个中文句式中说「最终值为1。」
我在想,是不是有一个可能,在连1.的时候出来1.但我一旦在1.后再输入一个. (即1..),则又能还原成1。呢?
谢谢。
NPerovic wrote: ↑08 Sep 2023, 20:44。是按 . 出來的,所以要用 . 而不是。
而 :: 後面的 1. 在預設狀態下還是按下 1.,所以要使用 T 選項讓 :: 後面的一切按照字面上的字符輸入,而不是根據鍵盤位置輸入。
從 0 到 9Code: Select all
:*T:1.::1.
Code: Select all
#Requires AutoHotkey v2 Loop 10 Hotstring ":*T:" (Key := A_Index - 1) ".", key "."
Re: Hotstring问题 Topic is solved
可以,用 InputHook 捕獲下一個按鍵,如果是 . 的話,就還原成中文的句號。
Code: Select all
#Requires AutoHotkey v2
:*:1.::
:*:2.::
:*:3.::
:*:4.::
:*:5.::
:*:6.::
:*:7.::
:*:8.::
:*:9.::
:*:0.::{
SendText(SubStr(ThisHotkey, 4))
ih := InputHook("V L1 B", ".")
ih.OnEnd := ih => (ih.EndKey = "." && SendText("`b`b。")) ; `b 等於 Backspace
ih.Start()
ih.Wait()
}
Dark Theme for Everything
Other Scripts
- Dark Theme MsgBox & InputBox
- Dark Theme ListView Control
- ToolTip with System Theme Awareness
- Dark Theme WindowSpy
Other Scripts
- Customize Gui Button Color
- SetWindowColor.ahk - Customise the Colour of the Title Bar and Border.
- KeyboardLayout.ahk - Switching between Keyboard Layouts
- MouseHook.ahk - Tool for Intercepting Mouse Events
- ToolTipEx.ahk - Extension for Custom Tooltips
Re: Hotstring问题
非常感谢。
Re: Hotstring问题
@NPerovic
您好,用着用着又发现了一个bug:
我输入 1句号的时候确实是名号变点号了。但我输入11句号的时候,这个功能就失效了。所以上面的代码不能处理若干个数字输入后带一个名号的情况吗?
谢谢。
您好,用着用着又发现了一个bug:
我输入 1句号的时候确实是名号变点号了。但我输入11句号的时候,这个功能就失效了。所以上面的代码不能处理若干个数字输入后带一个名号的情况吗?
谢谢。
Re: Hotstring问题
這樣反而簡單多了。
Code: Select all
#Requires AutoHotkey v2
#Hotstring EndChars .
Loop 10
Hotstring ":B0TO?:" (A_Index-1) ".", "`b。"
Dark Theme for Everything
Other Scripts
- Dark Theme MsgBox & InputBox
- Dark Theme ListView Control
- ToolTip with System Theme Awareness
- Dark Theme WindowSpy
Other Scripts
- Customize Gui Button Color
- SetWindowColor.ahk - Customise the Colour of the Title Bar and Border.
- KeyboardLayout.ahk - Switching between Keyboard Layouts
- MouseHook.ahk - Tool for Intercepting Mouse Events
- ToolTipEx.ahk - Extension for Custom Tooltips
Re: Hotstring问题
再次感谢.怎么说呢,约等于是神迹了(我真看不懂)NPerovic wrote: ↑31 Oct 2023, 01:26這樣反而簡單多了。Code: Select all
#Requires AutoHotkey v2 #Hotstring EndChars . Loop 10 Hotstring ":B0TO?:" (A_Index-1) ".", "`b。"
Who is online
Users browsing this forum: No registered users and 10 guests