From ee97cfc33d13549ed054f255f54511040d5ff849 Mon Sep 17 00:00:00 2001 From: abgox Date: Wed, 1 Jan 2025 17:16:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B2=A1=E6=9C=89=E5=AE=9E=E6=97=B6=E7=94=9F?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v2/InputTip.JAB.JetBrains.exe | Bin 1318912 -> 1318912 bytes src/v2/InputTip.ahk | 4 ++-- src/v2/utils/options.ahk | 4 ++-- src/v2/utils/show.ahk | 14 ++++++++------ src/v2/utils/tray-menu.ahk | 20 +++++++++----------- src/v2/utils/var.ahk | 10 +++++----- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/v2/InputTip.JAB.JetBrains.exe b/src/v2/InputTip.JAB.JetBrains.exe index d89a8316b061baca81c897a63953be4f1d489907..f609893d4ff0d234337da373daffe4b5ad38f6b5 100644 GIT binary patch delta 529 zcmZ9{%_{_990%~{d5pz)H^11C^mr+zhV~^TBIF=Ro0N;xFb}pC+wLerl;q6i!O34B zh30^)a&S=&ZsfFAu@^5F`4QQ6>NDT@{+^ebwM1ww5js4k^!@0BwqvZP*k+1R^qpBq zLD|TIa!@YHLn_Kg1*i}ep<+~mN>Q1cV%h|qS?(t!sgR%Nb_WRH*I!R!?@a6UyFdog zdNiY-W%S%VAb0Hlz6bYG(YCK?&>g;_t>li=k#t8x6jsPDSR% ztq7kL!tM*(!sOxjh!u9^sS2-hONDyKJZ5sAAs?VJkY*Aft@sY&cAUT9oV9hx5*?b^f{(^b delta 568 zcmZoT5YTWSV8a$h#-7bv8Lfd-^GBxkk4%g}45FEVm<5PgftU@5*@2h?h&h3n3y8Ua zmZi2**f-&JCccu)+|(i+1zke}15K`y?Rh_il?A1tf<~r5A&|U=CQyHR zPJU8i&h!E<5s~S4xJ3lnbQFMEYNuc368W}Wjz?q@7h}No3t}R1jFPH)ds*K9V_;xp zkYND25Qw4lbax4ndZ5Vk6A~gxAX-OKL{5l-!H7W*h%LY*P(8!+7@+v{f07~wAVq5= sMfBK=K;jJ3A4rP$fy4}?MACrt_8C$l8LT-G0gf&%o__97DuR}L01_RQyZ`_I diff --git a/src/v2/InputTip.ahk b/src/v2/InputTip.ahk index b9ea9f2..c0e62dd 100644 --- a/src/v2/InputTip.ahk +++ b/src/v2/InputTip.ahk @@ -73,8 +73,8 @@ checkUpdateDone() cursorDir := readIni("cursorDir", "") picDir := readIni("picDir", ":") -SetTimer(getDir, -1) -getDir() { +SetTimer(_getDirTimer, -1) +_getDirTimer() { _cursorDir := arrJoin(getCursorDir(), ":") _picDir := arrJoin(getPicDir(), ":") if (cursorDir != _cursorDir) { diff --git a/src/v2/utils/options.ahk b/src/v2/utils/options.ahk index f455883..220d510 100644 --- a/src/v2/utils/options.ahk +++ b/src/v2/utils/options.ahk @@ -13,5 +13,5 @@ InstallMouseHook CoordMode 'Mouse', 'Screen' SetStoreCapsLockMode 0 -;@AHK2Exe-SetVersion 2.28.2 -currentVersion := "2.28.2" +;@AHK2Exe-SetVersion 2.28.3 +currentVersion := "2.28.3" diff --git a/src/v2/utils/show.ahk b/src/v2/utils/show.ahk index 9182c06..a39b3b2 100644 --- a/src/v2/utils/show.ahk +++ b/src/v2/utils/show.ahk @@ -100,12 +100,9 @@ while 1 { updateDelay() { if (HideSymbolDelay) { - SetTimer(timer, 25) - timer() { - global - if (HideSymbolDelay = 0) { - SetTimer(, 0) - } + SetTimer(updateDelayTimer, 25) + updateDelayTimer() { + global needHide, isWait if (GetKeyState("LButton", "P")) { needHide := 0 isWait := 1 @@ -122,6 +119,11 @@ updateDelay() { needHide := 0 } } + if (HideSymbolDelay = 0) { + SetTimer(updateDelayTimer, 0) + needHide := 0 + isWait := 0 + } } } } diff --git a/src/v2/utils/tray-menu.ahk b/src/v2/utils/tray-menu.ahk index 8eb3dca..9fb0bc4 100644 --- a/src/v2/utils/tray-menu.ahk +++ b/src/v2/utils/tray-menu.ahk @@ -309,8 +309,8 @@ makeTrayMenu() { isOpen := 0 } else { isOpen := 1 - SetTimer(timer, 25) - timer() { + SetTimer(statusTimer, 25) + statusTimer() { if (isOpen) { info := IME.CheckInputMode() ToolTip("状态码: " IME.CheckInputMode().statusMode "`n切换码: " IME.CheckInputMode().conversionMode) @@ -573,9 +573,7 @@ makeTrayMenu() { } writeIni("HideSymbolDelay", value) global HideSymbolDelay := value - if (value > 0) { - updateDelay() - } + updateDelay() restartJetBrains() } configGui.AddEdit("xs Disabled -VScroll w" Gui_width, "单位: 毫秒,默认为 0 毫秒,表示不隐藏符号。`n当不为 0 时,此值不能小于 150,若小于 150,实际生效的值是 150。建议 500 以上。`n符号隐藏后,下次键盘操作或点击鼠标左键会再次显示符号") @@ -996,8 +994,8 @@ makeTrayMenu() { configGui.AddLink(, 'https://colordesigner.io/color-palette-builder') configGui.Show() - SetTimer(getDir, -1) - getDir() { + SetTimer(getDirTimer, -1) + getDirTimer() { _cursorDir := arrJoin(getCursorDir(), ":") _picDir := arrJoin(getPicDir(), ":") if (cursorDir != _cursorDir) { @@ -1582,8 +1580,8 @@ makeTrayMenu() { } runJetBrains() } else { - SetTimer(timer2, -100) - timer2() { + SetTimer(killAppTimer, -10) + killAppTimer() { try { RunWait('taskkill /f /t /im InputTip.JAB.JetBrains.exe', , "Hide") if (A_IsAdmin) { @@ -2009,8 +2007,8 @@ getPicDir() { * @param runOrStop 1: Run; 0:Stop */ runJetBrains() { - SetTimer(timer, -100) - timer() { + SetTimer(runAppTimer, -10) + runAppTimer() { if (A_IsAdmin) { try { RunWait('powershell -NoProfile -Command $action = New-ScheduledTaskAction -Execute "`'\"' A_ScriptDir '\InputTip.JAB.JetBrains.exe\"`'";$principal = New-ScheduledTaskPrincipal -UserId "' A_UserName '" -LogonType ServiceAccount -RunLevel Limited;$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable -DontStopOnIdleEnd -ExecutionTimeLimit 10 -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1);$task = New-ScheduledTask -Action $action -Principal $principal -Settings $settings;Register-ScheduledTask -TaskName "abgox.InputTip.JAB.JetBrains" -InputObject $task -Force', , "Hide") diff --git a/src/v2/utils/var.ahk b/src/v2/utils/var.ahk index 03e822d..34d6e4c 100644 --- a/src/v2/utils/var.ahk +++ b/src/v2/utils/var.ahk @@ -308,12 +308,12 @@ updateSymbol(init := 0) { reloadCursor() { if (changeCursor) { if (GetKeyState("CapsLock", "T")) { - loadCursor("Caps") + loadCursor("Caps", 1) } else { if (isCN()) { - loadCursor("CN") + loadCursor("CN", 1) } else { - loadCursor("EN") + loadCursor("EN", 1) } } } @@ -357,8 +357,8 @@ pauseApp(*) { restartJetBrains() { static done := 1 if (done && enableJetBrainsSupport) { - SetTimer(timer, -100) - timer() { + SetTimer(restartAppTimer, -10) + restartAppTimer() { done := 0 RunWait('taskkill /f /t /im InputTip.JAB.JetBrains.exe', , "Hide") if (A_IsAdmin) { From de8f245b6b9aeac437dc958cba16d9ff3afe4a9b Mon Sep 17 00:00:00 2001 From: abgox Date: Wed, 1 Jan 2025 17:48:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E9=99=90=E5=88=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=8F=AF=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=8C=83=E5=9B=B4=EF=BC=8C=E9=81=BF=E5=85=8D=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v2/CHANGELOG.md | 5 +++++ src/v2/utils/tray-menu.ahk | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/v2/CHANGELOG.md b/src/v2/CHANGELOG.md index f8970a7..5b42009 100644 --- a/src/v2/CHANGELOG.md +++ b/src/v2/CHANGELOG.md @@ -4,6 +4,11 @@ - 没有特别说明的版本都是修复问题 +## 2.28.3 + +- 修复了配置修改没有实时生效的问题 +- 限制更新检测可设置的时间范围,避免程序错误 + ## 2.28.2 - 修复了白名单机制对于 InputTip 自身创建的窗口无效的问题 diff --git a/src/v2/utils/tray-menu.ahk b/src/v2/utils/tray-menu.ahk index 9fb0bc4..854a668 100644 --- a/src/v2/utils/tray-menu.ahk +++ b/src/v2/utils/tray-menu.ahk @@ -78,15 +78,20 @@ makeTrayMenu() { fn(x, y, w, h) { g := Gui("AlwaysOnTop", "InputTip - 设置更新检测") g.SetFont(fz, "微软雅黑") - g.AddText("cRed", "- 单位是分钟,默认是 1440 分钟,即一天。`n- 如果不为 0,在 InputTip 启动后,会立即检测一次。`n- 如果为 0,则表示不自动检测更新。`n") + g.AddText("cRed", "- 单位: 分钟,默认 1440 分钟(1 天)。`n- 避免程序错误,可以设置的最大范围是 0-50000 分钟。`n- 如果为 0,则表示不检测版本更新。`n- 如果不为 0,在 InputTip 启动后,会立即检测一次。`n- 如果大于 50000,则会直接使用 50000。`n") g.AddText("xs", "每隔多少分钟检测一次更新: ") - _c := g.AddEdit("yp Number vcheckUpdateDelay") + _c := g.AddEdit("yp Number Limit5 vcheckUpdateDelay") _c.Value := readIni("checkUpdateDelay", 1440) _c.OnEvent("Change", fn_change_delay) + g.AddText() fn_change_delay(item, *) { - if (item.value != "") { - writeIni("checkUpdateDelay", item.value) - global checkUpdateDelay := item.value + value := item.Value + if (value != "") { + if (value > 50000) { + value := 50000 + } + writeIni("checkUpdateDelay", value) + global checkUpdateDelay := value if (checkUpdateDelay) { checkUpdate() }