From 1edd9422887d36ad0ce6acf3a661f4bf1b6556de Mon Sep 17 00:00:00 2001 From: abgox Date: Sun, 12 Jan 2025 18:06:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=202?= =?UTF-8?q?.30.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v2/CHANGELOG.md | 5 +++ src/v2/InputTip.JAB.JetBrains.exe | Bin 1355776 -> 1355264 bytes src/v2/InputTip.ahk | 13 +------- src/v2/utils/check-version.ahk | 53 +++++++++++++++++++++++++++++- src/v2/utils/options.ahk | 4 +-- src/v2/utils/tools.ahk | 16 +++++++-- src/v2/utils/var.ahk | 44 ++----------------------- src/v2/version.txt | 2 +- 8 files changed, 77 insertions(+), 60 deletions(-) diff --git a/src/v2/CHANGELOG.md b/src/v2/CHANGELOG.md index f541ce4..4cfc4c6 100644 --- a/src/v2/CHANGELOG.md +++ b/src/v2/CHANGELOG.md @@ -2,6 +2,11 @@ - 没有特别说明的版本都是修复问题 +## 2.30.2 + +- 修复了在极少数情况下(如 UAC 弹窗时),触发报错(拒绝访问)的问题 +- 其他的修复和优化 + ## 2.30.1 - 修复了 `符号显示白名单` 添加应用进程时会在 `InputTip.ini` 中写入两次的问题 diff --git a/src/v2/InputTip.JAB.JetBrains.exe b/src/v2/InputTip.JAB.JetBrains.exe index ca67fd3485e7fcc235505fa5417176a5bb2f380d..6b8b938f6132521ab485849daee939a1ae7c7672 100644 GIT binary patch delta 373 zcmZp85Y%udXoDjoquOLA#wsQmt&zfnodQ4&nS0j7Hm? z14Yb5wpXW%@G@<;%MvkCkuE8!RH)|i%`YuZbx$n`$S>B=QP5FP3(w5coZiwWqQ_QJ zT9l_?uzhWxh`czX<+f;>E*W1cg@5f`|1aJ$k4oJ$mTDKg4&lvQ1)jmmkbCJM%p6&O6&bYug94j|&(p zugmz6w5NXhf;BAfsTiS2f>7?U6niGcFdzZJI1VI$W55V73XB0Va2z-Ri~|$ENnjE< z1)TP!ShDtHt8)*bUvboX_KPV5DUm(^eYH>1QVK2i>E@9BJf!2ZDfCV{^xK_Fp{c~7 zRuJ;PKTld;ao%6NL*|Gf>@MAuD<-co-B8jMv(*-Nc`L_Fo>pn7t4yq0Mj#!bi?&m> z40hvIIxD-hp^L^k7&sjs3^w2ksD|z^TF~T8xnpy|ycI^KuesrLF`9-@WzZ24w7fQ) zoBiYRjgbqbo?&likOfN%LsddmVNfXw@?J5LNra_<$<&p9hx9uak8pOqH-gN}@>Qxl zuxx|bbcPd?pv~7WvnCVl?@s?e#r2=Ak>WX0 zwb~B5$;55Tp(?!R?{m}p@q*<1@t5T68DH5UCLY6R8o@0@*nhiAVi@PWo%h6oJD2=G HDkHxE(bx8V diff --git a/src/v2/InputTip.ahk b/src/v2/InputTip.ahk index d3b09a1..dd7b04a 100644 --- a/src/v2/InputTip.ahk +++ b/src/v2/InputTip.ahk @@ -81,16 +81,7 @@ if (A_IsCompiled) { checkIni() ; 检查配置文件 -; 检查更新 -try { - ignoreUpdate := IniRead("InputTip.ini", "Config-v2", "ignoreUpdate") - if (ignoreUpdate) { - checkUpdateDelay := readIni("checkUpdateDelay", 0) - } else { - checkUpdateDelay := readIni("checkUpdateDelay", 1440) - } - IniDelete("InputTip.ini", "Config-v2", "ignoreUpdate") -} +checkUpdateDone() checkUpdateDelay := readIni("checkUpdateDelay", 1440) @@ -98,8 +89,6 @@ checkUpdateDelay := readIni("checkUpdateDelay", 1440) checkUpdate(1) -checkUpdateDone() - cursorDir := readIni("cursorDir", "") picDir := readIni("picDir", ":") diff --git a/src/v2/utils/check-version.ahk b/src/v2/utils/check-version.ahk index 18b8d71..cf5408a 100644 --- a/src/v2/utils/check-version.ahk +++ b/src/v2/utils/check-version.ahk @@ -238,10 +238,61 @@ checkUpdate(init := 0) { */ checkUpdateDone() { if (FileExist(A_AppData "\.abgox-InputTip-update-version.txt")) { + try { + JetBrains_list := IniRead("InputTip.ini", "Config-v2", "JetBrains_list") + writeIni("cursor_mode_JAB", JetBrains_list) + IniDelete("InputTip.ini", "Config-v2", "JetBrains_list") + } + try { + ignoreUpdate := IniRead("InputTip.ini", "Config-v2", "ignoreUpdate") + if (ignoreUpdate) { + checkUpdateDelay := readIni("checkUpdateDelay", 0) + } else { + checkUpdateDelay := readIni("checkUpdateDelay", 1440) + } + IniDelete("InputTip.ini", "Config-v2", "ignoreUpdate") + } + + try { + IniRead("InputTip.ini", "InputMethod", "statusModeEN") + } catch { + mode := readIni("mode", 1, "InputMethod") + switch mode { + case 2: + { + writeIni("mode", 1, "InputMethod") + } + case 3: + { + ; 讯飞输入法 + ; 中文时状态码为 2 + ; 英文时状态码为 1 + ; 切换码无规律不唯一 + writeIni("statusModeEN", ":1:", "InputMethod") + writeIni("conversionModeEN", "", "InputMethod") + writeIni("mode", 2, "InputMethod") + } + case 4: + { + ; 手心输入法: + ; 中文时切换码为 1025 + ; 英文时切换码为 1 + ; 状态码一直为 1 + writeIni("statusModeEN", "", "InputMethod") + writeIni("conversionModeEN", ":1:", "InputMethod") + writeIni("mode", 3, "InputMethod") + } + } + border_type := readIni('border_type', 1) + if (border_type = 4) { + writeIni('border_type', 0) + } + } + createGui(fn).Show() fn(x, y, w, h) { g := Gui("AlwaysOnTop", "InputTip - 版本更新完成") - g.SetFont(fz, "微软雅黑") + g.SetFont("s14", "微软雅黑") g.AddText(, "版本更新完成,当前版本: ") g.AddText("yp cRed", currentVersion) g.AddText("xs", "-------------------------------------------") diff --git a/src/v2/utils/options.ahk b/src/v2/utils/options.ahk index a715f9e..74b90b6 100644 --- a/src/v2/utils/options.ahk +++ b/src/v2/utils/options.ahk @@ -12,5 +12,5 @@ InstallKeybdHook CoordMode 'Mouse', 'Screen' SetStoreCapsLockMode 0 -;@AHK2Exe-SetVersion 2.30.1 -currentVersion := "2.30.1" +;@AHK2Exe-SetVersion 2.30.2 +currentVersion := "2.30.2" diff --git a/src/v2/utils/tools.ahk b/src/v2/utils/tools.ahk index 445455a..ad92a5c 100644 --- a/src/v2/utils/tools.ahk +++ b/src/v2/utils/tools.ahk @@ -13,8 +13,11 @@ hasChildDir(path) { } isMouseOver(WinTitle) { - MouseGetPos , , &Win - return WinExist(WinTitle " ahk_id " Win) + try { + MouseGetPos(, , &Win) + return WinExist(WinTitle " ahk_id " Win) + } + return 0 } replaceEnvVariables(str) { @@ -50,6 +53,15 @@ getScreenInfo() { } return list } + +/** + * 调用时外层必须使用 try 包裹,因为 MouseGetPos 在极少数情况下,会因为权限问题报错拒绝访问 + * @example + * try { + * isWhichScreen() + * ; ... + * } + */ isWhichScreen(screenList) { MouseGetPos(&x, &y) for v in screenList { diff --git a/src/v2/utils/var.ahk b/src/v2/utils/var.ahk index c695ba8..15af1eb 100644 --- a/src/v2/utils/var.ahk +++ b/src/v2/utils/var.ahk @@ -4,41 +4,6 @@ fz := "s" readIni("gui_font_size", "12") ; 输入法模式 mode := readIni("mode", 1, "InputMethod") -try { - IniRead("InputTip.ini", "InputMethod", "statusModeEN") -} catch { - switch mode { - case 2: - { - writeIni("mode", 1, "InputMethod") - } - case 3: - { - ; 讯飞输入法 - ; 中文时状态码为 2 - ; 英文时状态码为 1 - ; 切换码无规律不唯一 - writeIni("statusModeEN", ":1:", "InputMethod") - writeIni("conversionModeEN", "", "InputMethod") - writeIni("mode", 2, "InputMethod") - } - case 4: - { - ; 手心输入法: - ; 中文时切换码为 1025 - ; 英文时切换码为 1 - ; 状态码一直为 1 - writeIni("statusModeEN", "", "InputMethod") - writeIni("conversionModeEN", ":1:", "InputMethod") - writeIni("mode", 3, "InputMethod") - } - } - border_type := readIni('border_type', 1) - if (border_type = 4) { - writeIni('border_type', 0) - } -} - statusModeEN := readIni("statusModeEN", "", "InputMethod") conversionModeEN := readIni("conversionModeEN", "", "InputMethod") checkTimeout := readIni("checkTimeout", 500, "InputMethod") @@ -67,14 +32,9 @@ delay := readIni("delay", 50) ; 开机自启动 isStartUp := readIni("isStartUp", 0) -; 启用 JetBrains 支持 -enableJetBrainsSupport := readIni("enableJetBrainsSupport", 0) -try { - JetBrains_list := IniRead("InputTip.ini", "Config-v2", "JetBrains_list") - writeIni("cursor_mode_JAB", JetBrains_list) - IniDelete("InputTip.ini", "Config-v2", "JetBrains_list") -} +; 启用 JAB/JetBrains 支持 +enableJetBrainsSupport := readIni("enableJetBrainsSupport", 0) updateList(1) diff --git a/src/v2/version.txt b/src/v2/version.txt index bcec02e..0958964 100644 --- a/src/v2/version.txt +++ b/src/v2/version.txt @@ -1 +1 @@ -2.30.1 +2.30.2