Skip to content

Commit

Permalink
fix: 更新版本 2.30.2
Browse files Browse the repository at this point in the history
  • Loading branch information
abgox committed Jan 12, 2025
1 parent 9648481 commit 1edd942
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 60 deletions.
5 changes: 5 additions & 0 deletions src/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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

## 2.30.2

- 修复了在极少数情况下(如 UAC 弹窗时),触发报错(拒绝访问)的问题
- 其他的修复和优化

## 2.30.1

- 修复了 `符号显示白名单` 添加应用进程时会在 `InputTip.ini` 中写入两次的问题
Expand Down
Binary file modified src/v2/InputTip.JAB.JetBrains.exe
Binary file not shown.
13 changes: 1 addition & 12 deletions src/v2/InputTip.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,14 @@ 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)

#Include .\utils\var.ahk

checkUpdate(1)

checkUpdateDone()

cursorDir := readIni("cursorDir", "")
picDir := readIni("picDir", ":")

Expand Down
53 changes: 52 additions & 1 deletion src/v2/utils/check-version.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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", "-------------------------------------------")
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 @@ -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"
16 changes: 14 additions & 2 deletions src/v2/utils/tools.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -50,6 +53,15 @@ getScreenInfo() {
}
return list
}

/**
* 调用时外层必须使用 try 包裹,因为 MouseGetPos 在极少数情况下,会因为权限问题报错拒绝访问
* @example
* try {
* isWhichScreen()
* ; ...
* }
*/
isWhichScreen(screenList) {
MouseGetPos(&x, &y)
for v in screenList {
Expand Down
44 changes: 2 additions & 42 deletions src/v2/utils/var.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/v2/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.30.1
2.30.2

0 comments on commit 1edd942

Please sign in to comment.