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/InputTip.JAB.JetBrains.exe b/src/v2/InputTip.JAB.JetBrains.exe index d89a831..f609893 100644 Binary files a/src/v2/InputTip.JAB.JetBrains.exe and b/src/v2/InputTip.JAB.JetBrains.exe differ 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..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() } @@ -309,8 +314,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 +578,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 +999,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 +1585,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 +2012,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) {