Skip to content

Commit

Permalink
Merge pull request #133 from abgox/v2
Browse files Browse the repository at this point in the history
feat: 更新版本 2.29.0
  • Loading branch information
abgox authored Jan 11, 2025
2 parents 6f09e9d + 16d0d88 commit 67ecdbf
Show file tree
Hide file tree
Showing 24 changed files with 3,112 additions and 2,509 deletions.
60 changes: 34 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@

> [通过 AutoHotkey 官方论坛中 Descolada 大佬给出的解决方案实现](https://www.autohotkey.com/boards/viewtopic.php?t=130941#p576439)
> [!Note]
>
> 如果有其他 JAB 程序,也可以按照此步骤进行设置
1. 打开 Java Access Bridge (java 访问桥)

- 如果命令不存在,请 [下载并安装 OpenJDK JRE](https://adoptium.net/temurin/releases/?os=windows&arch=x64&package=jre&version=8)
Expand All @@ -194,21 +198,19 @@
jabswitch -enable
```

2. 点击 `托盘菜单` => `启用 JetBrains IDE 支持`
2. 点击 `托盘菜单` => `启用 JAB/JetBrains IDE 支持`

- 会在 `InputTip.exe` 同级目录下生成 `InputTip.JAB.JetBrains.exe`
- 它由 `InputTip.exe` 控制,不需要手动启动/终止

3. 点击 `托盘菜单` => `添加 JetBrains IDE 应用`,确保你使用的 JetBrains IDE 应用已经添加
3. 点击 `托盘菜单` => `设置光标获取模式`,将 JetBrains IDE 应用添加到其中的 `JAB` 列表中

4. 重启 JetBrains IDE 应用
4. 如果未生效,请重启正在使用的 JetBrains IDE

5. 如果没有生效,可能需要重启电脑
5. 如果仍未生效,请重启 InputTip 或重启系统

> [!TIP]
> 如果你有多块屏幕,JetBrains IDE 在副屏上,会有非常大的坐标偏差
>
> 你需要通过 `托盘菜单` => `设置特殊偏移量` => `设置 JetBrains 系列 IDE 的偏移量` 手动调整
> 如果有多块屏幕,副屏幕上可能有坐标偏差,需要通过 `托盘菜单` => `设置特殊偏移量` 手动调整
### 关于符号

Expand Down Expand Up @@ -243,7 +245,7 @@

> [!Tip]
>
> 也可以直接下载 [已经适配好的鼠标样式](https://inputtip.pages.dev/download/extra) 来使用
> 也可以直接下载 [已经适配的鼠标样式](https://inputtip.pages.dev/download/extra) 来使用
> [!Tip]
>
Expand Down Expand Up @@ -296,40 +298,46 @@
>
> 这里的兼容情况也仅供参考,实际情况可能有所不同,你应该自行尝试
>
> 如果是**讯飞**输入法或**手心**输入法,直接使用对应模式即可
> - 一般使用 `通用模式`如果是 [讯飞输入法](https://srf.xunfei.cn/)[手心输入法](https://www.xinshuru.com/),直接使用对应模式即可
>
> 建议尝试的顺序是 `通用模式` > `自定义`
> - 否则,使用 `自定义`
>
> [输入法模式的已知问题](https://inputtip.pages.dev/FAQ/#输入法模式的已知问题)
> - [输入法模式的已知问题](https://inputtip.pages.dev/FAQ/#输入法模式的已知问题)
- 已知可用的输入法(通过模式切换兼容)

- `通用模式`(默认):

- **微信**输入法
- **搜狗**(五笔)输入法
- **QQ**输入法
- **微软**(拼音/五笔)
- **冰凌**(五笔)输入法
- **小狼毫(rime)** 输入法
- **小鹤音形**输入法(使用 [多多输入法生成器](https://duo.ink/ddimegen/ddimegen-desc.html) 生成)
- [微信输入法](https://z.weixin.qq.com/)
- [搜狗输入法](https://shurufa.sogou.com/)
- [搜狗五笔输入法](https://wubi.sogou.com/)
- [QQ 输入法](https://qq.pinyin.cn/)
- [百度输入法](https://shurufa.baidu.com/)
- 微软
- 微软拼音
- 微软五笔
- 微软仓颉
- [冰凌输入法](https://icesofts.com/)
- [小狼毫(rime)输入法](https://rime.im/download/)
- 小鹤音形输入法
- 需要使用 [多多输入法生成器](https://duo.ink/ddimegen/ddimegen-desc.html) 生成
- 使用 [多多输入法生成器](https://duo.ink/ddimegen/ddimegen-desc.html) 生成的输入法都可用
- **百度**输入法
- **谷歌**输入法
- **微软仓颉**输入法
- **小小**输入法
- **影子**输入法
- [小小输入法](http://yongim.ysepan.com/)
- [影子输入法](https://gitee.com/orz707/Yzime)
- 需要关闭影子输入法中的 `tsf`
- 在键盘布局中,选择一个能正常识别状态的输入法(建议选择微信输入法、搜狗输入法等)
- 然后正常使用影子输入法即可
- [可可五笔](https://suke.kim/)
- 谷歌输入法

- `讯飞输入法`
- 如果正在使用 **讯飞**输入法,你需要选择它
- 如果正在使用 [讯飞输入法](https://srf.xunfei.cn/),你需要选择它
- `手心输入法`
- 如果你正在使用 **手心**输入法,你需要选择它
- 如果你正在使用 [手心输入法](https://www.xinshuru.com/),你需要选择它
- 兼容性一般,因为获取到的输入法状态可能有误,导致基于此的相关功能都可能有问题。
- `自定义`
- [关于设置输入法模式中的自定义](https://inputtip.pages.dev/FAQ/about-input-mode-custom)
- 一个万能的模式,需要根据实际情况设置状态码和切换码
- 详情参考: [关于设置输入法模式中的自定义](https://inputtip.pages.dev/FAQ/about-input-mode-custom)

- 如何进行模式切换
1. 运行 `InputTip.exe` 后,在底部任务栏右侧找到软件托盘图标
Expand Down
15 changes: 15 additions & 0 deletions src/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

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

## 2.29.0

- 添加了 `设置光标获取模式`
- 现在,你可以指定应用使用哪种光标获取模式
- 如果所有模式都不可用,则表示在此窗口中获取不到光标位置,暂时无法解决
- `添加 JetBrains IDE 应用` 合并到其中
- 将 JetBrains IDE 应用添加到 `JAB` 列表中即可
- 添加了 `设置特殊偏移量`
- 你可以指定应用在不同屏幕下的特殊偏移量
- `设置 JetBrains 系统 IDE 的偏移量` 合并到其中
- 由于 `设置 JetBrains 系统 IDE 的偏移量` 不好迁移,可能需要通过 `设置特殊偏移量` 重新设置
-`更改配置` 中添加了 `其他杂项` 标签页
- 其中包含配置: `所有配置菜单的字体大小`
- 其他的修复和优化

## 2.28.6

- 完善了自动切换的逻辑
Expand Down
11 changes: 6 additions & 5 deletions src/v2/InputTip.JAB.JetBrains.ahk
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#Include .\utils\options.ahk

#NoTrayIcon
;@AHK2Exe-SetName InputTip.JAB.JetBrains
;@AHK2Exe-SetDescription InputTip(JetBrains 进程) - 一个输入法状态(中文/英文/大写锁定)提示工具
;@AHK2Exe-SetName InputTip.JAB
;@AHK2Exe-SetDescription InputTip(JAB 进程) - 一个输入法状态(中文/英文/大写锁定)提示工具

#Include .\utils\IME.ahk
#Include .\utils\ini.ahk
#Include .\utils\app-list.ahk
#Include .\utils\var.ahk
#Include .\utils\tools.ahk

needSkip(exe_str) {
return !InStr(JetBrains_list, exe_str)
return !InStr(modeList.JAB, exe_str)
}

returnCanShowSymbol(&left, &top) {
GetCaretPosFromJetBrains(&left, &top)
try {
left += IniRead("InputTip.ini", "config-v2", "offset_JetBrains_x_" isWhichScreen(screenList).num)
top += IniRead("InputTip.ini", "config-v2", "offset_JetBrains_y_" isWhichScreen(screenList).num)
left += app_offset.%exe_name%.%isWhichScreen(screenList).num%.x
top += app_offset.%exe_name%.%isWhichScreen(screenList).num%.y
}
return left
}
Expand Down
Binary file modified src/v2/InputTip.JAB.JetBrains.exe
Binary file not shown.
34 changes: 16 additions & 18 deletions src/v2/InputTip.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A_IconTip := "InputTip - 一个输入法状态(中文/英文/大写锁定)提示
#Include .\utils\ini.ahk
#Include .\utils\IME.ahk
#Include .\utils\check-version.ahk
#Include .\utils\tray-menu.ahk
#Include .\menu\tray-menu.ahk

#Include .\utils\tools.ahk
#Include .\utils\app-list.ahk
Expand All @@ -29,11 +29,12 @@ gc := {
w: {
; 开机自启动
startupGui: "",
cancelStartupGui: "",
; 设置更新检测
checkUpdateGui: "",
; 设置输入法模式
inputModeGui: "",
; 设置光标获取模式
cursorModeGui: "",
; 符号显示黑/白名单
bwListGui: "",
; 暂停/运行快捷键
Expand All @@ -45,15 +46,13 @@ gc := {
; 指定窗口自动切换状态
windowToggleGui: "",
; 设置特殊偏移量
appOffsetGui: "",
offsetGui: "",
; 设置 JetBrains IDE 偏移量
JetBrainsOffsetGui: "",
; 启用 JetBrains IDE 支持
enableJetBrainsGui: "",
; 应用列表
blackListGui: "",
whiteListGui: "",
addJetBrainsGui: "",
; 关于
aboutGui: "",
; 二级菜单
Expand All @@ -63,12 +62,6 @@ gc := {
}
}

; 配置菜单的字体大小
fz := "s12"
if (A_ScreenHeight < 1000 || A_ScreenWidth < 2000) {
fz := "s10"
}

if (A_IsCompiled) {
favicon := A_ScriptFullPath
; 生成特殊的快捷方式,它会通过任务计划程序启动
Expand Down Expand Up @@ -157,11 +150,15 @@ if (hotkey_Pause) {
}

needSkip(exe_str) {
return InStr(JetBrains_list, exe_str)
return InStr(modeList.JAB, exe_str)
}

returnCanShowSymbol(&left, &top) {
res := GetCaretPosEx(&left, &top)
try {
left += app_offset.%exe_name%.%isWhichScreen(screenList).num%.x
top += app_offset.%exe_name%.%isWhichScreen(screenList).num%.y
}
return res && left
}

Expand Down Expand Up @@ -237,25 +234,26 @@ GetCaretPosEx(&left?, &top?, &right?, &bottom?) {
}
hwnd := getHwnd()

if (InStr(appList.disable, exe_str) && !useWhiteList) {
if (InStr(modeList.disable, exe_str) && !useWhiteList) {
return 0
}
else if (InStr(appList.UIA, exe_str)) {

if (InStr(modeList.UIA, exe_str)) {
return getCaretPosFromUIA()
}
else if (InStr(appList.MSAA, exe_str)) {
else if (InStr(modeList.MSAA, exe_str)) {
return getCaretPosFromMSAA()
}
else if (InStr(appList.GUI_UIA, exe_str)) {
else if (InStr(modeList.GUI_UIA, exe_str)) {
if (getCaretPosFromGui(&hwnd := 0)) {
return 1
}
return getCaretPosFromUIA()
}
else if (InStr(appList.Hook_with_dll, exe_str)) {
else if (InStr(modeList.Hook_DLL, exe_str)) {
return getCaretPosFromHook(1)
}
else if (InStr(appList.wpf, exe_str)) {
else if (InStr(modeList.WPF, exe_str)) {
return getCaretPosFromWpfCaret()
}
else {
Expand Down
51 changes: 51 additions & 0 deletions src/v2/menu/JAB.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
fn_JAB(item, *) {
global enableJetBrainsSupport := !enableJetBrainsSupport
writeIni("enableJetBrainsSupport", enableJetBrainsSupport)
A_TrayMenu.ToggleCheck(item)
if (enableJetBrainsSupport) {
FileInstall("InputTip.JAB.JetBrains.exe", "InputTip.JAB.JetBrains.exe", 1)
waitFileInstall("InputTip.JAB.JetBrains.exe", 0)

ideGui := Gui("AlwaysOnTop", "InputTip - 启用 JAB/JetBrains IDE 支持")
ideGui.SetFont(fz, "微软雅黑")
ideGui.AddText(, "------------------------------------------------------------------------------")
ideGui.Show("Hide")
ideGui.GetPos(, , &Gui_width)
ideGui.Destroy()

ideGui := Gui("AlwaysOnTop", "InputTip - 启用 JAB/JetBrains IDE 支持")
ideGui.SetFont(fz, "微软雅黑")
ideGui.AddText(, "已经成功启用了 JAB/JetBrains IDE 支持,你还需要进行以下步骤:")

ideGui.AddEdit("xs -VScroll ReadOnly w" Gui_width, "1. 开启 Java Access Bridge`n2. 点击托盘菜单中的「设置光标获取模式」`n3. 将 JetBrains IDE 或其他 JAB 程序添加到其中的「JAB」列表中`n4. 如果未生效,请重启正在使用的 JetBrains IDE 或其他 JAB 程序`n5. 如果仍未生效,请重启 InputTip 或重启系统`n6. 有多块屏幕时,副屏幕上可能有坐标偏差,需要通过「设置特殊偏移量」调整")
ideGui.AddLink(, '详细操作步骤,请查看: <a href="https://inputtip.pages.dev/FAQ/use-inputtip-in-jetbrains">InputTip 官网</a> <a href="https://github.com/abgox/InputTip#如何在-jetbrains-系列-ide-中使用-inputtip">Github</a> <a href="https://gitee.com/abgox/InputTip#如何在-jetbrains-系列-ide-中使用-inputtip">Gitee</a>')
y := ideGui.AddButton("xs w" Gui_width, "我知道了")
y.OnEvent("Click", yes)
y.Focus()
ideGui.OnEvent("Close", yes)
yes(*) {
ideGui.Destroy()
gc.w.enableJetBrainsGui := ""
}
gc.w.enableJetBrainsGui := ideGui
ideGui.Show()
runJetBrains()
} else {
if (gc.w.enableJetBrainsGui) {
gc.w.enableJetBrainsGui.Destroy()
gc.w.enableJetBrainsGui := ""
}
SetTimer(killAppTimer, -10)
killAppTimer() {
try {
RunWait('taskkill /f /t /im InputTip.JAB.JetBrains.exe', , "Hide")
if (A_IsAdmin) {
Run('schtasks /delete /tn "abgox.InputTip.JAB.JetBrains" /f', , "Hide")
try {
FileDelete("InputTip.JAB.JetBrains.exe")
}
}
}
}
}
}
60 changes: 60 additions & 0 deletions src/v2/menu/about.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
fn_about(*) {
if (gc.w.aboutGui) {
gc.w.aboutGui.Destroy()
gc.w.aboutGui := ""
}
aboutGui := Gui("AlwaysOnTop")
aboutGui.SetFont(fz, "微软雅黑")
aboutGui.AddText(, "InputTip - 一个输入法状态(中文/英文/大写锁定)提示工具")
aboutGui.AddLink(, '- 因为实现简单,就是去掉 v1 中方块符号的文字,加上不同的背景颜色')
aboutGui.AddPicture("w365 h-1", "InputTipSymbol\default\offer.png")
aboutGui.Show("Hide")
aboutGui.GetPos(, , &Gui_width)
aboutGui.Destroy()

aboutGui := Gui("AlwaysOnTop", "InputTip - v" currentVersion)
aboutGui.SetFont(fz, "微软雅黑")
aboutGui.AddText("Center w" Gui_width, "InputTip - 一个输入法状态(中文/英文/大写锁定)实时提示工具")
tab := aboutGui.AddTab3("-Wrap", ["关于项目", "赞赏支持", "参考项目", "其他项目"])
tab.UseTab(1)
aboutGui.AddText("Section", '当前版本: ')
aboutGui.AddEdit("yp ReadOnly cRed", currentVersion)
aboutGui.AddText("xs", '开发人员: ')
aboutGui.AddEdit("yp ReadOnly", 'abgox')
aboutGui.AddText("xs", 'QQ 账号: ')
aboutGui.AddEdit("yp ReadOnly", '1151676611')
aboutGui.AddText("xs", 'QQ 群聊(交流反馈): ')
aboutGui.AddEdit("yp ReadOnly", '451860327')
aboutGui.AddText("xs", "-------------------------------------------------------------------------------")
aboutGui.AddLink("xs", '1. 官网: <a href="https://inputtip.pages.dev">https://inputtip.pages.dev</a>')
aboutGui.AddLink("xs", '2. Github: <a href="https://github.com/abgox/InputTip">https://github.com/abgox/InputTip</a>')
aboutGui.AddLink("xs", '3. Gitee: <a href="https://gitee.com/abgox/InputTip">https://gitee.com/abgox/InputTip</a>')
tab.UseTab(2)
aboutGui.AddText("Section", "如果 InputTip 对你有所帮助,你也可以出于善意, 向我捐款。`n非常感谢对 InputTip 的支持!希望 InputTip 能一直帮助你!")
aboutGui.AddPicture("w432 h-1", "InputTipSymbol\default\offer.png")
tab.UseTab(3)
aboutGui.AddLink("Section", '1. <a href="https://github.com/aardio/ImTip">ImTip - aardio</a>')
aboutGui.AddLink("xs", '2. <a href="https://github.com/flyinclouds/KBLAutoSwitch">KBLAutoSwitch - flyinclouds</a>')
aboutGui.AddLink("xs", '3. <a href="https://github.com/Tebayaki/AutoHotkeyScripts">AutoHotkeyScripts - Tebayaki</a>')
aboutGui.AddLink("xs", '4. <a href="https://github.com/Autumn-one/RedDot">RedDot - Autumn-one</a>')
aboutGui.AddLink("xs", '5. <a href="https://github.com/yakunins/language-indicator">language-indicator - yakunins</a>')
aboutGui.AddLink("xs", '- InputTip v1 是在鼠标附近显示带文字的方块符号')
aboutGui.AddLink("xs", '- InputTip v2 默认通过不同颜色的鼠标样式来区分')
aboutGui.AddLink("xs", '- 后来参照了 RedDot 和 language-indicator 的设计')
aboutGui.AddLink("xs", '- 因为实现很简单,就是去掉 v1 中方块符号的文字,加上不同的背景颜色')

tab.UseTab(4)
aboutGui.AddLink("Section w" Gui_width, '1. <a href="https://pscompletions.pages.dev/">PSCompletions</a> : 一个 PowerShell 补全模块,它能让你在 PowerShell 中更简单、更方便地使用命令补全。')
aboutGui.AddLink("Section w" Gui_width, '2. ...')

tab.UseTab(0)
btn := aboutGui.AddButton("Section w" Gui_width + aboutGui.MarginX * 2, "关闭")
btn.Focus()
btn.OnEvent("Click", fn_close)
aboutGui.OnEvent("Close", fn_close)
fn_close(*) {
aboutGui.Destroy()
}
gc.w.aboutGui := aboutGui
aboutGui.Show()
}
Loading

0 comments on commit 67ecdbf

Please sign in to comment.