Skip to content

Commit

Permalink
Merge pull request #127 from abgox/v2
Browse files Browse the repository at this point in the history
fix: 更新版本 2.28.3
  • Loading branch information
abgox authored Jan 1, 2025
2 parents db97f8a + de8f245 commit c61a27c
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 31 deletions.
5 changes: 5 additions & 0 deletions src/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

- 没有特别说明的版本都是修复问题

## 2.28.3

- 修复了配置修改没有实时生效的问题
- 限制更新检测可设置的时间范围,避免程序错误

## 2.28.2

- 修复了白名单机制对于 InputTip 自身创建的窗口无效的问题
Expand Down
Binary file modified src/v2/InputTip.JAB.JetBrains.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions src/v2/InputTip.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/v2/utils/options.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
14 changes: 8 additions & 6 deletions src/v2/utils/show.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -122,6 +119,11 @@ updateDelay() {
needHide := 0
}
}
if (HideSymbolDelay = 0) {
SetTimer(updateDelayTimer, 0)
needHide := 0
isWait := 0
}
}
}
}
Expand Down
35 changes: 19 additions & 16 deletions src/v2/utils/tray-menu.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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符号隐藏后,下次键盘操作或点击鼠标左键会再次显示符号")
Expand Down Expand Up @@ -996,8 +999,8 @@ makeTrayMenu() {
configGui.AddLink(, '<a href="https://colordesigner.io/color-palette-builder">https://colordesigner.io/color-palette-builder</a>')

configGui.Show()
SetTimer(getDir, -1)
getDir() {
SetTimer(getDirTimer, -1)
getDirTimer() {
_cursorDir := arrJoin(getCursorDir(), ":")
_picDir := arrJoin(getPicDir(), ":")
if (cursorDir != _cursorDir) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions src/v2/utils/var.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c61a27c

Please sign in to comment.