Skip to content

Commit

Permalink
fix: update version to 2.26.5
Browse files Browse the repository at this point in the history
  • Loading branch information
abgox committed Dec 16, 2024
1 parent 504ee0c commit 0de4690
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 61 deletions.
6 changes: 5 additions & 1 deletion src/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

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

## 2.26.5

- 修复了在 JetBrains 系列 IDE 中,图片符号不显示的问题
- 其他的修复和优化

## 2.26.2

- 修复了直接通过项目仓库运行 `InputTip.ahk` 的一些使用问题
Expand Down Expand Up @@ -32,7 +37,6 @@
- `模式4` => `模式4 - 手心输入法`
- 修复当使用 `暂停软件运行` 时,符号可能有残留的问题


## 2.24.1

- 修复了 `InputTip.exe` 运行后,相关文件无法正常释放出来的问题
Expand Down
60 changes: 34 additions & 26 deletions src/v2/InputTip.JAB.JetBrains.ahk
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#Requires AutoHotkey v2.0
;@AHK2Exe-SetName InputTip.JAB.JetBrains
;@AHK2Exe-SetLanguage 0x0804
;@AHK2Exe-SetDescription InputTip(JetBrains 进程) - 一个输入法状态(中文/英文/大写锁定)提示工具
;@Ahk2Exe-SetCopyright Copyright (c) 2023-present abgox
;@Ahk2Exe-SetMainIcon ..\favicon.ico
#SingleInstance Force
#Warn All, Off
#NoTrayIcon
Persistent
ListLines 0
Expand Down Expand Up @@ -34,6 +36,7 @@ readIni(key, default, section := "Config-v2", path := "InputTip.ini") {
}

mode := readIni("mode", 2, "InputMethod")
delay := readIni("delay", 50)
JetBrains_list := ":" readIni("JetBrains_list", "") ":"
changeCursor := readIni("changeCursor", 0)
symbolType := readIni("symbolType", 2)
Expand Down Expand Up @@ -194,18 +197,23 @@ for v in info {
v.origin := replaceEnvVariables(RegRead("HKEY_CURRENT_USER\Control Panel\Cursors", curMap.%v.type%))
}
if (v.EN = "" || v.CN = "" || v.Caps = "") {
if (v.origin) {
v.EN := v.CN := v.Caps := v.origin
} else {
v.EN := v.CN := v.Caps := ""
}
v.EN := v.CN := v.Caps := v.origin
}
}
showPicList := ":"
fileList := ["CN", "EN", "Caps"]
for f in fileList {
if (FileExist(f ".png")) {
showPicList .= f ":"
picList := {
EN: '',
CN: '',
Caps: ''
}
loop files "InputTipSymbol\*" {
if(InStr(A_LoopFileName,"EN.png")){
picList.EN := A_LoopFilePath
}
if(InStr(A_LoopFileName,"CN.png")){
picList.CN := A_LoopFilePath
}
if(InStr(A_LoopFileName,"Caps.png")){
picList.Caps := A_LoopFilePath
}
}

Expand Down Expand Up @@ -266,10 +274,9 @@ if (changeCursor) {
}
if (!InStr(JetBrains_list, ":" exe_name ":")) {
TipGui.Hide()
Sleep(50)
Sleep(delay)
continue
}
is_hide_state := 0
if (exe_name != lastWindow) {
needHide := 0
SetTimer(timer, HideSymbolDelay)
Expand All @@ -289,6 +296,7 @@ if (changeCursor) {
is_hide_state := InStr(app_hide_state, ":" exe_name ":")
if (needHide && HideSymbolDelay && A_TimeIdleKeyboard > HideSymbolDelay) {
TipGui.Hide()
Sleep(delay)
continue
}
if (A_TimeIdle < 500) {
Expand Down Expand Up @@ -321,15 +329,15 @@ if (changeCursor) {
old_left := left
old_top := top
old_state := state
Sleep(50)
Sleep(delay)
continue
}
try {
state := isCN(mode)
v := state = 1 ? "CN" : "EN"
} catch {
TipGui.Hide()
Sleep(50)
Sleep(delay)
continue
}
if (state != old_state) {
Expand All @@ -353,15 +361,15 @@ if (changeCursor) {
}
}
}
Sleep(50)
Sleep(delay)
}
} else {
while 1 {
try {
exe_name := ProcessGetName(WinGetPID("A"))
}
if (!InStr(JetBrains_list, ":" exe_name ":")) {
Sleep(50)
Sleep(delay)
continue
}
if (exe_name != lastWindow) {
Expand All @@ -382,22 +390,22 @@ if (changeCursor) {
state := 2
}
old_state := state
Sleep(50)
Sleep(delay)
continue
}
try {
state := isCN(mode)
v := state = 1 ? "CN" : "EN"
} catch {
Sleep(50)
Sleep(delay)
continue
}
if (state != old_state) {
show(v)
old_state := state
}
}
Sleep(50)
Sleep(delay)
}
}
show(type) {
Expand All @@ -413,10 +421,9 @@ if (changeCursor) {
}
if (!InStr(JetBrains_list, ":" exe_name ":")) {
TipGui.Hide()
Sleep(50)
Sleep(delay)
continue
}
is_hide_state := 0
if (exe_name != lastWindow) {
needHide := 0
SetTimer(timer2, HideSymbolDelay)
Expand All @@ -436,6 +443,7 @@ if (changeCursor) {
is_hide_state := InStr(app_hide_state, ":" exe_name ":")
if (needHide && HideSymbolDelay && A_TimeIdleKeyboard > HideSymbolDelay) {
TipGui.Hide()
Sleep(delay)
continue
}
if (A_TimeIdle < 500) {
Expand Down Expand Up @@ -467,15 +475,15 @@ if (changeCursor) {
old_left := left
old_top := top
old_state := state
Sleep(50)
Sleep(delay)
continue
}
try {
state := isCN(mode)
v := state = 1 ? "CN" : "EN"
} catch {
TipGui.Hide()
Sleep(50)
Sleep(delay)
continue
}
if (state != old_state) {
Expand All @@ -498,7 +506,7 @@ if (changeCursor) {
}
}
}
Sleep(50)
Sleep(delay)
}
}
}
Expand All @@ -507,9 +515,9 @@ TipShow(type) {
switch symbolType {
case 1:
{
if (InStr(showPicList, ":" type ":")) {
if (picList.%type%) {
try {
TipGuiPic.Value := "InputTipSymbol/" type ".png"
TipGuiPic.Value := picList.%type%
try {
TipGui.Show("NA x" left + pic_offset_x "y" top + pic_offset_y)
}
Expand Down
Binary file modified src/v2/InputTip.JAB.JetBrains.exe
Binary file not shown.
58 changes: 24 additions & 34 deletions src/v2/InputTip.ahk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Requires AutoHotkey v2.0
;@AHK2Exe-SetName InputTip
;@AHK2Exe-SetVersion 2.26.3
;@AHK2Exe-SetVersion 2.26.5
;@AHK2Exe-SetLanguage 0x0804
;@Ahk2Exe-SetMainIcon ..\favicon.ico
;@AHK2Exe-SetDescription InputTip - 一个输入法状态(中文/英文/大写锁定)提示工具
Expand All @@ -10,6 +10,7 @@
;@Ahk2Exe-AddResource InputTipSymbol.zip
;@Ahk2Exe-AddResource InputTip.JAB.JetBrains.exe
#SingleInstance Force
#Warn All, Off
Persistent
ListLines 0
KeyHistory 0
Expand All @@ -27,7 +28,7 @@ A_IconTip := "InputTip - 一个输入法状态(中文/英文/大写锁定)提示
#Include .\utils\createGui.ahk
#Include .\utils\checkVersion.ahk

currentVersion := "2.26.3"
currentVersion := "2.26.5"

filename := SubStr(A_ScriptName, 1, StrLen(A_ScriptName) - 4)

Expand Down Expand Up @@ -207,36 +208,16 @@ pic_offset_y := readIni('pic_offset_y', -20)
pic_symbol_width := readIni('pic_symbol_width', 9)
pic_symbol_height := readIni('pic_symbol_height', 9)
; 应用列表: 需要隐藏符号
app_hide_state := readIni('app_hide_state', '')
if (InStr(app_hide_state, "exe,")) {
app_hide_state := StrReplace(app_hide_state, ",", ":")
writeIni('app_hide_state', app_hide_state)
}
app_hide_state := ":" app_hide_state ":"
app_hide_state := ":" readIni('app_hide_state', '') ":"

; 应用列表: 自动切换到中文
app_CN := readIni('app_CN', '')
if (InStr(app_CN, "exe,")) {
app_CN := StrReplace(app_CN, ",", ":")
writeIni('app_CN', app_CN)
}
app_CN := ":" app_CN ":"
app_CN := ":" readIni('app_CN', '') ":"

; 应用列表: 自动切换到英文
app_EN := readIni('app_EN', '')
if (InStr(app_EN, "exe,")) {
app_EN := StrReplace(app_EN, ",", ":")
writeIni('app_EN', app_EN)
}
app_EN := ":" app_EN ":"
app_EN := ":" readIni('app_EN', '') ":"

; 应用列表: 自动切换到大写锁定
app_Caps := readIni('app_Caps', '')
if (InStr(app_Caps, "exe,")) {
app_Caps := StrReplace(app_Caps, ",", ":")
writeIni('app_Caps', app_Caps)
}
app_Caps := ":" app_Caps ":"
app_Caps := ":" readIni('app_Caps', '') ":"

; 中文快捷键
hotkey_CN := readIni('hotkey_CN', '')
Expand Down Expand Up @@ -463,7 +444,7 @@ for v in info {
v.EN := v.CN := v.Caps := v.origin
}
}
showPicList := ":"

fileList := ["CN", "EN", "Caps"]

symbol_temp_zip := A_Temp "\abgox-InputTipSymbol-temp.zip"
Expand Down Expand Up @@ -503,9 +484,20 @@ if (!DirExist("InputTipSymbol")) {
}
}
}
for f in fileList {
if (FileExist("InputTipSymbol\" f ".png")) {
showPicList .= f ":"
picList := {
EN: '',
CN: '',
Caps: ''
}
loop files "InputTipSymbol\*" {
if(InStr(A_LoopFileName,"EN.png")){
picList.EN := A_LoopFilePath
}
if(InStr(A_LoopFileName,"CN.png")){
picList.CN := A_LoopFilePath
}
if(InStr(A_LoopFileName,"Caps.png")){
picList.Caps := A_LoopFilePath
}
}

Expand Down Expand Up @@ -799,9 +791,9 @@ TipShow(type) {
switch symbolType {
case 1:
{
if (InStr(showPicList, ":" type ":")) {
if (picList.%type%) {
try {
TipGuiPic.Value := "InputTipSymbol/" type ".png"
TipGuiPic.Value := picList.%type%
try {
TipGui.Show("NA x" left + pic_offset_x "y" top + pic_offset_y)
}
Expand Down Expand Up @@ -2030,8 +2022,6 @@ makeTrayMenu() {
aboutGui.AddLink("xs", '- 后来参照了 <a href="https://github.com/Autumn-one/RedDot">RedDot</a> 和 <a href="https://github.com/yakunins/language-indicator">language-indicator</a> 的设计')
aboutGui.AddLink("xs", '- 因为实现很简单,就是去掉 v1 中方块符号的文字,加上不同的背景颜色')



tab.UseTab(0)
btn := aboutGui.AddButton("Section w" Gui_width + aboutGui.MarginX * 2, "关闭")
btn.Focus()
Expand Down

0 comments on commit 0de4690

Please sign in to comment.