From 7eeca2951ec485c913884a0701118d04b916cee9 Mon Sep 17 00:00:00 2001 From: abgox Date: Mon, 23 Dec 2024 19:46:43 +0800 Subject: [PATCH] fix: update version to 2.27.2 --- .vscode/extensions.json | 3 + .vscode/settings.json | 6 ++ src/v2/CHANGELOG.md | 5 ++ src/v2/InputTip.JAB.JetBrains.ahk | 51 ++++++++++----- src/v2/InputTip.JAB.JetBrains.exe | Bin 1318400 -> 1318912 bytes src/v2/InputTip.ahk | 105 +++++++++++++++++++----------- src/v2/utils/appList.ahk | 91 ++++++++++++++++++++++++++ 7 files changed, 207 insertions(+), 54 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 src/v2/utils/appList.ahk diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c461a66 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["thqby.vscode-autohotkey2-lsp"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c4ecc07 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "editor.formatOnSave": true, + "[ahk]": { + "editor.defaultFormatter": "thqby.vscode-autohotkey2-lsp" + } +} diff --git a/src/v2/CHANGELOG.md b/src/v2/CHANGELOG.md index 75ccc38..b420e97 100644 --- a/src/v2/CHANGELOG.md +++ b/src/v2/CHANGELOG.md @@ -4,6 +4,11 @@ - 没有特别说明的版本都是修复问题 +## 2.27.2 + +- 修复了运行 `InputTip.exe` 时,任务栏的一些 bug +- 其他的修复和优化 + ## 2.27.0 - 鼠标样式不再通过打开文件夹去设置,而是会动态的生成下拉列表进行选择,图片符号同理。 diff --git a/src/v2/InputTip.JAB.JetBrains.ahk b/src/v2/InputTip.JAB.JetBrains.ahk index 3e017b2..4f00d66 100644 --- a/src/v2/InputTip.JAB.JetBrains.ahk +++ b/src/v2/InputTip.JAB.JetBrains.ahk @@ -280,14 +280,20 @@ lastWindow := "" lastState := state needHide := 1 exe_name := "" +exe_str := "::" if (changeCursor) { if (symbolType) { while 1 { + if (isMouseOver("ahk_class Shell_TrayWnd")) { + Sleep(delay) + continue + } try { exe_name := ProcessGetName(WinGetPID("A")) + exe_str := ":" exe_name ":" } - if (!InStr(JetBrains_list, ":" exe_name ":")) { + if (!InStr(JetBrains_list, exe_str)) { TipGui.Hide() Sleep(delay) continue @@ -300,22 +306,21 @@ if (changeCursor) { } WinWaitActive("ahk_exe" exe_name) lastWindow := exe_name - if (InStr(app_CN, ":" exe_name ":")) { + if (InStr(app_CN, exe_str)) { switch_CN() - } else if (InStr(app_EN, ":" exe_name ":")) { + } else if (InStr(app_EN, exe_str)) { switch_EN() - } else if (InStr(app_Caps, ":" exe_name ":")) { + } else if (InStr(app_Caps, exe_str)) { switch_Caps() } } - is_hide_state := InStr(app_hide_state, ":" exe_name ":") if (needHide && HideSymbolDelay && A_TimeIdleKeyboard > HideSymbolDelay) { TipGui.Hide() Sleep(delay) continue } if (A_TimeIdle < 500) { - if (is_hide_state) { + if (InStr(app_hide_state, exe_str)) { canShowSymbol := 0 TipGui.Hide() } else { @@ -380,21 +385,26 @@ if (changeCursor) { } } else { while 1 { + if (isMouseOver("ahk_class Shell_TrayWnd")) { + Sleep(delay) + continue + } try { exe_name := ProcessGetName(WinGetPID("A")) + exe_str := ":" exe_name ":" } - if (!InStr(JetBrains_list, ":" exe_name ":")) { + if (!InStr(JetBrains_list, exe_str)) { Sleep(delay) continue } if (exe_name != lastWindow) { WinWaitActive("ahk_exe" exe_name) lastWindow := exe_name - if (InStr(app_CN, ":" exe_name ":")) { + if (InStr(app_CN, exe_str)) { switch_CN() - } else if (InStr(app_EN, ":" exe_name ":")) { + } else if (InStr(app_EN, exe_str)) { switch_EN() - } else if (InStr(app_Caps, ":" exe_name ":")) { + } else if (InStr(app_Caps, exe_str)) { switch_Caps() } } @@ -433,10 +443,15 @@ if (changeCursor) { } else { if (symbolType) { while 1 { + if (isMouseOver("ahk_class Shell_TrayWnd")) { + Sleep(delay) + continue + } try { exe_name := ProcessGetName(WinGetPID("A")) + exe_str := ":" exe_name ":" } - if (!InStr(JetBrains_list, ":" exe_name ":")) { + if (!InStr(JetBrains_list, exe_str)) { TipGui.Hide() Sleep(delay) continue @@ -449,22 +464,21 @@ if (changeCursor) { } WinWaitActive("ahk_exe" exe_name) lastWindow := exe_name - if (InStr(app_CN, ":" exe_name ":")) { + if (InStr(app_CN, exe_str)) { switch_CN() - } else if (InStr(app_EN, ":" exe_name ":")) { + } else if (InStr(app_EN, exe_str)) { switch_EN() - } else if (InStr(app_Caps, ":" exe_name ":")) { + } else if (InStr(app_Caps, exe_str)) { switch_Caps() } } - is_hide_state := InStr(app_hide_state, ":" exe_name ":") if (needHide && HideSymbolDelay && A_TimeIdleKeyboard > HideSymbolDelay) { TipGui.Hide() Sleep(delay) continue } if (A_TimeIdle < 500) { - if (is_hide_state) { + if (InStr(app_hide_state, exe_str)) { canShowSymbol := 0 TipGui.Hide() } else { @@ -582,6 +596,11 @@ TipShow(type) { } } +isMouseOver(WinTitle) { + MouseGetPos , , &Win + return WinExist(WinTitle " ahk_id " Win) +} + replaceEnvVariables(str) { while RegExMatch(str, "%\w+%", &match) { env := match[] diff --git a/src/v2/InputTip.JAB.JetBrains.exe b/src/v2/InputTip.JAB.JetBrains.exe index 6cd723abd124410ed6679518b6013b1d4591e9ce..ced47702b1bd5694ebd23ed5767608b6c957513e 100644 GIT binary patch delta 947 zcmZqJ6VPxVV1p$iogM{sT0=&I}QTD@+LU7-owwNU|dM8Vn5E zFS7{G{J@u5ks4oIQlwyItDt0MH9hOAu#s+Nnu11Vv2T89ajJh=YLSLgVn%j+a!z7# zu|jZ0YEDjkNKs;CcwUNP< zk~%&9n{We6VEX%S!dh_7eMS)-S*TKw@m$5_nI*{?@y>|_#TuGiwOqB+vzSEshGE+caNGwU!0b2_6jpla$AHtn1wDAZxlIwt;H=kbkSJ)fwehkmRWVSo~ z6Xs*0jgw$@0K@hX z$UU_rAir2a2ME=Gl3YcpC8b4q3P7f7MP_k{226v3k^(55Wu^cbKrzkj*SJKyIGF+* Tw=0NtOh=WE0P?ReA!Pka+@ z5I|Qj-T%9=7N%&!cVQh&(Y;I}5(35X8JQ`m@x>*HC8-KlwhGe|nMK5~SbXxka360b zvg+;i%p!Lfw+H?bUdx1VGe4S>rrr^eo8I?LSZ?}") - g.AddText("yp cRed","v" newVersion) + g.AddText("yp cRed", "v" currentVersion) + g.AddText("yp ", ">") + g.AddText("yp cRed", "v" newVersion) g.AddText("xs", "- 请自行使用") g.AddText("yp cRed", "git pull") g.AddText("yp", "获取最新的代码更改") @@ -425,7 +426,6 @@ errAndExit() { } cursor_temp_zip := A_Temp "\abgox-InputTipCursor-temp.zip" -cursor_temp_dir := A_Temp "\abgox-InputTipCursor-temp" if (!DirExist("InputTipCursor") || !DirExist("InputTipCursor\default")) { FileInstall("InputTipCursor.zip", cursor_temp_zip, 1) waitFileInstall(cursor_temp_zip) @@ -463,6 +463,17 @@ for v in info { state := 0, old_state := '', old_left := '', old_top := '', left := 0, top := 0 TipGui := Gui("-Caption AlwaysOnTop ToolWindow LastFound") +appList := { + disable: ":" arrJoin(disable_list, ":") ":", + wpf: ":" arrJoin(Wpf_list, ":") ":", + UIA: ":" arrJoin(UIA_list, ":") ":", + MSAA: ":" arrJoin(MSAA_list, ":") ":", + GUI_UIA: ":" arrJoin(Gui_UIA_list, ":") ":", + Hook_with_dll: ":" arrJoin(Hook_list_with_dll, ":") ":" +} +; ACC_list := ":explorer.exe:ApplicationFrameHost.exe:" + + if (symbolType = 1) { ; 图片字符 TipGui.BackColor := "000000" @@ -508,14 +519,20 @@ lastWindow := "" lastState := state needHide := 1 exe_name := "" +exe_str := "::" if (changeCursor) { if (symbolType) { while 1 { + if (isMouseOver("ahk_class Shell_TrayWnd")) { + Sleep(delay) + continue + } try { exe_name := ProcessGetName(WinGetPID("A")) + exe_str := ":" exe_name ":" } - if (InStr(JetBrains_list, ":" exe_name ":")) { + if (InStr(JetBrains_list, exe_str)) { TipGui.Hide() Sleep(delay) continue @@ -528,22 +545,21 @@ if (changeCursor) { } WinWaitActive("ahk_exe" exe_name) lastWindow := exe_name - if (InStr(app_CN, ":" exe_name ":")) { + if (InStr(app_CN, exe_str)) { switch_CN() - } else if (InStr(app_EN, ":" exe_name ":")) { + } else if (InStr(app_EN, exe_str)) { switch_EN() - } else if (InStr(app_Caps, ":" exe_name ":")) { + } else if (InStr(app_Caps, exe_str)) { switch_Caps() } } - is_hide_state := InStr(app_hide_state, ":" exe_name ":") if (needHide && HideSymbolDelay && A_TimeIdleKeyboard > HideSymbolDelay) { TipGui.Hide() Sleep(delay) continue } if (A_TimeIdle < 500) { - if (is_hide_state) { + if (InStr(app_hide_state, exe_str)) { canShowSymbol := 0 TipGui.Hide() } else { @@ -604,21 +620,26 @@ if (changeCursor) { } } else { while 1 { + if (isMouseOver("ahk_class Shell_TrayWnd")) { + Sleep(delay) + continue + } try { exe_name := ProcessGetName(WinGetPID("A")) + exe_str := ":" exe_name ":" } - if (InStr(JetBrains_list, ":" exe_name ":")) { + if (InStr(JetBrains_list, exe_str)) { Sleep(delay) continue } if (exe_name != lastWindow) { WinWaitActive("ahk_exe" exe_name) lastWindow := exe_name - if (InStr(app_CN, ":" exe_name ":")) { + if (InStr(app_CN, exe_str)) { switch_CN() - } else if (InStr(app_EN, ":" exe_name ":")) { + } else if (InStr(app_EN, exe_str)) { switch_EN() - } else if (InStr(app_Caps, ":" exe_name ":")) { + } else if (InStr(app_Caps, exe_str)) { switch_Caps() } } @@ -657,10 +678,15 @@ if (changeCursor) { } else { if (symbolType) { while 1 { + if (isMouseOver("ahk_class Shell_TrayWnd")) { + Sleep(delay) + continue + } try { exe_name := ProcessGetName(WinGetPID("A")) + exe_str := ":" exe_name ":" } - if (InStr(JetBrains_list, ":" exe_name ":")) { + if (InStr(JetBrains_list, exe_str)) { TipGui.Hide() Sleep(delay) continue @@ -673,22 +699,21 @@ if (changeCursor) { } WinWaitActive("ahk_exe" exe_name) lastWindow := exe_name - if (InStr(app_CN, ":" exe_name ":")) { + if (InStr(app_CN, exe_str)) { switch_CN() - } else if (InStr(app_EN, ":" exe_name ":")) { + } else if (InStr(app_EN, exe_str)) { switch_EN() - } else if (InStr(app_Caps, ":" exe_name ":")) { + } else if (InStr(app_Caps, exe_str)) { switch_Caps() } } - is_hide_state := InStr(app_hide_state, ":" exe_name ":") if (needHide && HideSymbolDelay && A_TimeIdleKeyboard > HideSymbolDelay) { TipGui.Hide() Sleep(delay) continue } if (A_TimeIdle < 500) { - if (is_hide_state) { + if (InStr(app_hide_state, exe_str)) { canShowSymbol := 0 TipGui.Hide() } else { @@ -2105,6 +2130,11 @@ hasChildDir(path) { } } +isMouseOver(WinTitle) { + MouseGetPos , , &Win + return WinExist(WinTitle " ahk_id " Win) +} + /** * @param runOrStop 1: Run; 0:Stop */ @@ -2172,6 +2202,14 @@ isWhichScreen(screenList) { } } +arrJoin(arr, separator := ",") { + res := "" + for i, v in arr { + res .= i = arr.Length ? v : v separator + } + return res +} + /** * @link https://github.com/Tebayaki/AutoHotkeyScripts/blob/main/lib/GetCaretPosEx/GetCaretPosEx.ahk */ @@ -2180,35 +2218,26 @@ GetCaretPosEx(&left?, &top?, &right?, &bottom?) { DllCall("SetThreadDpiAwarenessContext", "ptr", -2, "ptr") } hwnd := getHwnd() - disable_list := ":StartMenuExperienceHost.exe:wetype_update.exe:AnLink.exe:wps.exe:PotPlayer.exe:PotPlayer64.exe:PotPlayerMini.exe:PotPlayerMini64.exe:HBuilderX.exe:ShareX.exe:clipdiary-portable.exe:" - Wpf_list := ":powershell_ise.exe:" - UIA_list := ":WINWORD.EXE:WindowsTerminal.exe:wt.exe:OneCommander.exe:YoudaoDict.exe:Mempad.exe:Taskmgr.exe:" - ; MSAA 可能有符号残留 - MSAA_list := ":EXCEL.EXE:DingTalk.exe:Notepad.exe:Notepad3.exe:Quicker.exe:skylark.exe:aegisub32.exe:aegisub64.exe:aegisub.exe:PandaOCR.exe:PandaOCR.Pro.exe:VStart6.exe:TIM.exe:PowerToys.PowerLauncher.exe:Foxmail.exe:" - ; ACC_list := ":explorer.exe:ApplicationFrameHost.exe:" - Gui_UIA_list := ":POWERPNT.EXE:Notepad++.exe:firefox.exe:devenv.exe:WeMeetApp.exe:" - ; 需要调用有兼容性问题的 dll 来更新光标位置的应用列表 - Hook_list_with_dll := ":WeChat.exe:" - - if (InStr(disable_list, ":" exe_name ":")) { + + if (InStr(appList.disable, exe_str)) { return 0 } - else if (InStr(UIA_list, ":" exe_name ":")) { + else if (InStr(appList.UIA, exe_str)) { return getCaretPosFromUIA() } - else if (InStr(MSAA_list, ":" exe_name ":")) { + else if (InStr(appList.MSAA, exe_str)) { return getCaretPosFromMSAA() } - else if (InStr(Gui_UIA_list, ":" exe_name ":")) { + else if (InStr(appList.GUI_UIA, exe_str)) { if (getCaretPosFromGui(&hwnd := 0)) { return 1 } return getCaretPosFromUIA() } - else if (InStr(Hook_list_with_dll, ":" exe_name ":")) { + else if (InStr(appList.Hook_with_dll, exe_str)) { return getCaretPosFromHook(1) } - else if (InStr(Wpf_list, ":" exe_name ":")) { + else if (InStr(appList.wpf, exe_str)) { return getCaretPosFromWpfCaret() } else { diff --git a/src/v2/utils/appList.ahk b/src/v2/utils/appList.ahk new file mode 100644 index 0000000..42cd138 --- /dev/null +++ b/src/v2/utils/appList.ahk @@ -0,0 +1,91 @@ +disable_list := [ + ; 规避任务栏和开始菜单中的显示问题 + "ShellExperienceHost.exe", + "StartMenuExperienceHost.exe", + ; WPS 无法使用,Office 可以正常使用 + "wps.exe", + ; HBuilderX 无法使用 + "HBuilderX.exe", + ; 微信输入法配置界面 + "wetype_update.exe", + ; PotPlayer 无法使用,没有什么输入场景,不太影响 + "PotPlayer.exe", + "PotPlayer64.exe", + "PotPlayerMini.exe", + "PotPlayerMini64.exe", + ; + "AnLink.exe", + ; + "ShareX.exe", + ; + "clipdiary-portable.exe" +] + +Wpf_list := [ + ; Windows PowerShell ISE + "powershell_ise.exe", +] + +UIA_list := [ + ; Word + "WINWORD.EXE", + ; 终端 + "WindowsTerminal.exe", + "wt.exe", + ; + "OneCommander.exe", + ; 有道词典 + "YoudaoDict.exe", + ; + "Mempad.exe", + ; + "Taskmgr.exe", +] + +; MSAA 可能有符号残留 +MSAA_list := [ + ; Excel + "EXCEL.EXE", + ; 钉钉 + "DingTalk.exe", + ; 记事本 + "Notepad.exe", + "Notepad3.exe", + ; 快速启动 + "Quicker.exe", + ; + "skylark.exe", + ; 字幕编辑器 + "aegisub32.exe", + "aegisub64.exe", + "aegisub.exe", + ; 图片文字识别 + "PandaOCR.exe", + "PandaOCR.Pro.exe", + ; 音速启动 + "VStart6.exe", + ; Tim + "TIM.exe", + ; PowerToys 快速启动器 + "PowerToys.PowerLauncher.exe", + ; 邮箱 + "Foxmail.exe", +] + +Gui_UIA_list := [ + ; PowerPoint(PPT) + "POWERPNT.EXE", + ; + "Notepad++.exe", + ; 火狐浏览器 + "firefox.exe", + ; Visual Studio + "devenv.exe" + ; 腾讯会议 + "WeMeetApp.exe" +] +; 需要调用有兼容性问题的 dll 来更新光标位置的应用列表 +Hook_list_with_dll := [ + ; 微信 + "WeChat.exe" +]