Skip to content

Commit

Permalink
Merge pull request #120 from abgox/v2
Browse files Browse the repository at this point in the history
fix: update version to 2.27.2
  • Loading branch information
abgox authored Dec 23, 2024
2 parents 34dd5a5 + 7eeca29 commit de74f0e
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 54 deletions.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["thqby.vscode-autohotkey2-lsp"]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"[ahk]": {
"editor.defaultFormatter": "thqby.vscode-autohotkey2-lsp"
}
}
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.27.2

- 修复了运行 `InputTip.exe` 时,任务栏的一些 bug
- 其他的修复和优化

## 2.27.0

- 鼠标样式不再通过打开文件夹去设置,而是会动态的生成下拉列表进行选择,图片符号同理。
Expand Down
51 changes: 35 additions & 16 deletions src/v2/InputTip.JAB.JetBrains.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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()
}
}
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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[]
Expand Down
Binary file modified src/v2/InputTip.JAB.JetBrains.exe
Binary file not shown.
Loading

0 comments on commit de74f0e

Please sign in to comment.