This topic created in 2201 days ago, the information mentioned may be changed or developed.
Supplement 1 · May 8, 2020
1.2.0
增加辅助功能支持。增强 app 检测能力。 不授权辅助功能权限,只能检测 Dock 上有图标的 app,启用辅助功能可以检测非 Dock app 。比如 Spotlight
Supplement 2 · Sep 8, 2020
更新 1.2.10
修复 bug
改进切换效率。
Supplement 3 · Nov 16, 2020
1.2.15
Apple Silicon 支持。
3 replies • 2020-05-05 17:39:20 +08:00
 |
|
3
nl101531 May 5, 2020
可以用 Hammerspoon 来实现,脚本可以按照下面方式写,对于 Item 的浮动窗口也能很好支持
```lua
local function Chinese() hs.keycodes.currentSourceID("im.rime.inputmethod.Squirrel.Rime") end
local function English() hs.keycodes.currentSourceID("com.apple.keylayout.ABC") end
-- app to expected ime config local app2Ime = {} app2Ime['iTerm2'] = 'English' app2Ime['Alfred 3'] = 'English'
function updateFocusAppInputMethod(appName) local ime = 'Chinese'
if app2Ime[appName] then ime = app2Ime[appName] end
if ime == 'English' then English() else Chinese() end end
local focusedApp = {'iTerm2','Google Chrome','IntelliJ IDEA','IntelliJ IDEA-EAP','钉钉','Code','幕布'}
-- 解决固定 APP hs.window.filter.new(focusedApp) :subscribe(hs.window.filter.windowFocused,function (win, appName) --print('windowFocused'..appName) updateFocusAppInputMethod(appName) end)
-- 解决浮动窗口 hs.window.filter.new{'iTerm2','Alfred 3'}:subscribe(hs.window.filter.windowOnScreen,function (win, appName) --print('windowOnScreen'..appName) updateFocusAppInputMethod(appName) end):subscribe(hs.window.filter.windowNotOnScreen,function (win, appName) local frontMostApp = hs.application.frontmostApplication() updateFocusAppInputMethod(frontMostApp:name()) end)
```
|