leaves615 / KeyboardHolder

https://keyboardholder.leavesc.com/
1.15k stars 33 forks source link

在应用中会莫名其妙的切换输入法 #143

Closed hqch0708 closed 8 months ago

hqch0708 commented 9 months ago

问题描述: 在应用中会莫名其妙的切换输入法 应用版本:1.12.9 操作系统版本:14.3 问题可复现的操作步骤:没有具体的规则 问题时段和日志文件: 2024-01-26 09:14:39:792 [3412095][AppDelegate:498]: flag string: textAreaActived 2024-01-26 09:14:40:419 [3395853][AppDelegate:365]: applicationActivated on Optional("<AXApplication \"com.microsoft.teams2\" (pid=67089)>"); pid:[67089] info: [:] at com.microsoft.teams2 2024-01-26 09:14:40:420 [3412208][Util:306]: focus element: nil 2024-01-26 09:14:40:420 [3412208][AppDelegate:497]: --- end for app[67089:Optional("com.microsoft.teams2")] switch flag[0x0000600001f12500] is 1 2024-01-26 09:14:40:421 [3412208][AppDelegate:498]: flag string: applicationActived 2024-01-26 09:14:40:421 [3412208][AppDelegate:887]: switch input for app com.microsoft.teams2 2024-01-26 09:14:40:421 [3412208][AppDelegate:815]: appInputStatus: SafeDictionary.SafeDictionary<Swift.String, Swift.String> 2024-01-26 09:14:40:421 [3412208][AppDelegate:816]: bundleIdentifier: com.microsoft.teams2 2024-01-26 09:14:40:421 [3412208][AppDelegate:817]: appLaunchId: Optional("com.apple.inputmethod.SCIM.ITABC") 2024-01-26 09:14:40:421 [3412208][AppDelegate:818]: appActiveId: Optional("last") 2024-01-26 09:14:40:421 [3412208][AppDelegate:819]: defaultLaunchId: Optional("com.apple.keylayout.ABC") 2024-01-26 09:14:40:421 [3412208][AppDelegate:820]: defaultActiveId: Optional("last") 2024-01-26 09:14:40:422 [3412208][AppDelegate:821]: cachedId: Optional("com.apple.keylayout.ABC") 2024-01-26 09:14:40:422 [3412208][AppDelegate:822]: isCustom: true 2024-01-26 09:14:40:422 [3412208][AppDelegate:823]: cached: true 2024-01-26 09:14:40:422 [3412208][AppDelegate:827]: custom 2024-01-26 09:14:40:422 [3412208][AppDelegate:836]: active 2024-01-26 09:14:40:422 [3412208][AppDelegate:840]: last 2024-01-26 09:14:40:422 [3412208][AppDelegate:872]: target id: Optional("com.apple.keylayout.ABC") 2024-01-26 09:14:40:422 [3412208][AppDelegate:891]: switching: Optional("ABC"), com.microsoft.teams2 2024-01-26 09:14:40:422 [3412208][AppDelegate:897]: switch input for nomal app. 2024-01-26 09:14:40:422 [3395853][AppDelegate:553]: cache status: com.microsoft.teams2 KeyboardHolder.InputSource 2024-01-26 09:14:40:423 [3395853][AppDelegate:739]: change: ABC for identifer: com.microsoft.teams2 2024-01-26 09:14:40:423 [3395853][AppDelegate:740]: start change. 2024-01-26 09:14:40:423 [3395853][AppDelegate:743]: current input source is correct, no need to do nothing. 是否启用了辅助控制:启用

leaves615 commented 8 months ago

日志看起来没有什么不妥

hqch0708 commented 8 months ago

我升级到最新的系统, 14.3.1就没有出现了。14.3.1修复了输入法相关的bug

hqch0708 commented 8 months ago

问题描述: com.microsoft.teams2 会自动切换到abc 应用版本: 1.12.9 操作系统版本:14.3.1 问题可复现的操作步骤: 1, 设置teams 启动:拼音,激活:上一次使用的输入法 2, 激活teams输入框,并将输入法切换到拼音 3, 点击teams其他地方,使输入框失去焦点 4, 等几秒钟后,输入法会自动切换到abc

开启了台前调度

日志: 2024-02-21 17:49:27:266 [4281713][AppDelegate:781]: floatWindowHide: Optional("com.apple.controlcenter"), current: Optional("com.microsoft.teams2") 2024-02-21 17:49:27:266 [4281713][AppDelegate:887]: switch input for app com.microsoft.teams2 2024-02-21 17:49:27:266 [4281713][AppDelegate:815]: appInputStatus: SafeDictionary.SafeDictionary<Swift.String, Swift.String> 2024-02-21 17:49:27:266 [4281713][AppDelegate:816]: bundleIdentifier: com.microsoft.teams2 2024-02-21 17:49:27:266 [4281713][AppDelegate:817]: appLaunchId: Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:27:267 [4281713][AppDelegate:818]: appActiveId: Optional("last") 2024-02-21 17:49:27:267 [4281713][AppDelegate:819]: defaultLaunchId: Optional("com.apple.keylayout.ABC") 2024-02-21 17:49:27:267 [4281713][AppDelegate:820]: defaultActiveId: Optional("last") 2024-02-21 17:49:27:267 [4281713][AppDelegate:821]: cachedId: Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:27:267 [4281713][AppDelegate:822]: isCustom: true 2024-02-21 17:49:27:267 [4281713][AppDelegate:823]: cached: true 2024-02-21 17:49:27:267 [4281713][AppDelegate:827]: custom 2024-02-21 17:49:27:267 [4281713][AppDelegate:836]: active 2024-02-21 17:49:27:267 [4281713][AppDelegate:840]: last 2024-02-21 17:49:27:268 [4281713][AppDelegate:872]: target id: Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:27:268 [4281713][AppDelegate:891]: switching: Optional("简体拼音"), com.microsoft.teams2 2024-02-21 17:49:27:268 [4281713][AppDelegate:897]: switch input for nomal app. 2024-02-21 17:49:27:268 [14803][AppDelegate:553]: cache status: com.microsoft.teams2 KeyboardHolder.InputSource 2024-02-21 17:49:27:268 [14803][AppDelegate:739]: change: 简体拼音 for identifer: com.microsoft.teams2 2024-02-21 17:49:27:268 [14803][AppDelegate:740]: start change. 2024-02-21 17:49:27:274 [14803][AppDelegate:751]: 0 2024-02-21 17:49:27:278 [14803][AppDelegate:642]: NSNotificationName(_rawValue: com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged) nil 2024-02-21 17:49:27:278 [14803][AppDelegate:680]: changing, skip input source change notify. 2024-02-21 17:49:27:279 [14803][AppDelegate:682]: changingIdentifer:com.microsoft.teams2,currentAppBundleId:com.apple.controlcenter,changingSource:Optional("com.apple.inputmethod.SCIM.ITABC"),currentSource:Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:27:284 [14803][AppDelegate:642]: NSNotificationName(_rawValue: com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged) nil 2024-02-21 17:49:27:285 [14803][AppDelegate:680]: changing, skip input source change notify. 2024-02-21 17:49:27:285 [14803][AppDelegate:682]: changingIdentifer:com.microsoft.teams2,currentAppBundleId:com.apple.controlcenter,changingSource:Optional("com.apple.inputmethod.SCIM.ITABC"),currentSource:Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:27:291 [14803][AppDelegate:642]: NSNotificationName(_rawValue: com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged) nil 2024-02-21 17:49:27:292 [14803][AppDelegate:680]: changing, skip input source change notify. 2024-02-21 17:49:27:293 [14803][AppDelegate:682]: changingIdentifer:com.microsoft.teams2,currentAppBundleId:com.apple.controlcenter,changingSource:Optional("com.apple.inputmethod.SCIM.ITABC"),currentSource:Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:28:138 [14803][AppDelegate:365]: focusedUIElementChanged on Optional("<AXTextArea \"<AXUIElement 0x6000014cf600> {pid=90550}\" (pid=90550)>"); pid:[90550] info: [:] at com.microsoft.teams2.helper 2024-02-21 17:49:28:139 [14803][AppDelegate:365]: focusedUIElementChanged on Optional("<AXTextArea \"<AXUIElement 0x6000014cf600> {pid=90550}\" (pid=90550)>"); pid:[90545] info: [:] at com.microsoft.teams2 2024-02-21 17:49:28:139 [4281714][Util:306]: focus element: Optional(<AXTextArea "<AXUIElement 0x6000014ccb10> {pid=90550}" (pid=90550)>) 2024-02-21 17:49:28:140 [4281714][AppDelegate:497]: --- end for app[90550:Optional("com.microsoft.teams2.helper")] switch flag[0x0000600001a4bca0] is 10000000 2024-02-21 17:49:28:140 [4281714][AppDelegate:498]: flag string: textAreaActived 2024-02-21 17:49:28:141 [4281714][SwitchDecision:233]: TextAreaActive: runningApp.bundleIdentifier: Optional("com.microsoft.teams2.helper") appDelegate.currentAppBundleId: com.apple.controlcenter 2024-02-21 17:49:28:141 [4281714][SwitchDecision:234]: TextAreaActive: appDelegate.settingData!.inputSourceTip: false && flag.has(SwitchFlag.textAreaActived): true && runningApp.bundleIdentifier == appDelegate.currentAppBundleId: false && appDelegate.settingData?.textAreaTip ?? false: false 2024-02-21 17:49:28:141 [4281714][Util:306]: focus element: nil 2024-02-21 17:49:28:141 [4281714][AppDelegate:497]: --- end for app[90545:Optional("com.microsoft.teams2")] switch flag[0x0000600001a48400] is 10000000 2024-02-21 17:49:28:141 [4281714][AppDelegate:498]: flag string: textAreaActived 2024-02-21 17:49:28:142 [4281714][SwitchDecision:233]: TextAreaActive: runningApp.bundleIdentifier: Optional("com.microsoft.teams2") appDelegate.currentAppBundleId: com.apple.controlcenter 2024-02-21 17:49:28:142 [4281714][SwitchDecision:234]: TextAreaActive: appDelegate.settingData!.inputSourceTip: false && flag.has(SwitchFlag.textAreaActived): true && runningApp.bundleIdentifier == appDelegate.currentAppBundleId: false && appDelegate.settingData?.textAreaTip ?? false: false 2024-02-21 17:49:28:244 [14803][AppDelegate:642]: NSNotificationName(_rawValue: com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged) nil 2024-02-21 17:49:28:248 [14803][AppDelegate:680]: changing, skip input source change notify. 2024-02-21 17:49:28:249 [14803][AppDelegate:682]: changingIdentifer:com.microsoft.teams2,currentAppBundleId:com.apple.controlcenter,changingSource:Optional("com.apple.inputmethod.SCIM.ITABC"),currentSource:Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:28:254 [14803][AppDelegate:642]: NSNotificationName(_rawValue: com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged) nil 2024-02-21 17:49:28:254 [14803][AppDelegate:680]: changing, skip input source change notify. 2024-02-21 17:49:28:254 [14803][AppDelegate:682]: changingIdentifer:com.microsoft.teams2,currentAppBundleId:com.apple.controlcenter,changingSource:Optional("com.apple.inputmethod.SCIM.ITABC"),currentSource:Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:28:803 [14803][AppDelegate:365]: focusedUIElementChanged on Optional("<UIElementNoRole \"<AXUIElement 0x600001453270> {pid=90550}\" (pid=90550)>"); pid:[90550] info: [:] at com.microsoft.teams2.helper 2024-02-21 17:49:28:804 [14803][AppDelegate:365]: focusedUIElementChanged on Optional("<UIElementNoRole \"<AXUIElement 0x600001453270> {pid=90550}\" (pid=90550)>"); pid:[90545] info: [:] at com.microsoft.teams2 2024-02-21 17:49:28:804 [4281714][Util:306]: focus element: Optional(<UIElementNoRole "<AXUIElement 0x600001453210> {pid=90550}" (pid=90550)>) 2024-02-21 17:49:28:806 [4281714][AppDelegate:497]: --- end for app[90550:Optional("com.microsoft.teams2.helper")] switch flag[0x0000600001a4bca0] is 0 2024-02-21 17:49:28:806 [4281714][AppDelegate:498]: flag string: 2024-02-21 17:49:28:807 [4281714][SwitchDecision:233]: TextAreaActive: runningApp.bundleIdentifier: Optional("com.microsoft.teams2.helper") appDelegate.currentAppBundleId: com.apple.controlcenter 2024-02-21 17:49:28:807 [4281714][SwitchDecision:234]: TextAreaActive: appDelegate.settingData!.inputSourceTip: false && flag.has(SwitchFlag.textAreaActived): false && runningApp.bundleIdentifier == appDelegate.currentAppBundleId: false && appDelegate.settingData?.textAreaTip ?? false: false 2024-02-21 17:49:28:807 [4281714][Util:306]: focus element: nil 2024-02-21 17:49:28:807 [4281714][AppDelegate:497]: --- end for app[90545:Optional("com.microsoft.teams2")] switch flag[0x0000600001a48400] is 0 2024-02-21 17:49:28:807 [4281714][AppDelegate:498]: flag string: 2024-02-21 17:49:28:808 [4281714][SwitchDecision:233]: TextAreaActive: runningApp.bundleIdentifier: Optional("com.microsoft.teams2") appDelegate.currentAppBundleId: com.apple.controlcenter 2024-02-21 17:49:28:808 [4281714][SwitchDecision:234]: TextAreaActive: appDelegate.settingData!.inputSourceTip: false && flag.has(SwitchFlag.textAreaActived): false && runningApp.bundleIdentifier == appDelegate.currentAppBundleId: false && appDelegate.settingData?.textAreaTip ?? false: false 2024-02-21 17:49:29:162 [14803][AppDelegate:642]: NSNotificationName(_rawValue: com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged) nil 2024-02-21 17:49:29:165 [14803][AppDelegate:680]: changing, skip input source change notify. 2024-02-21 17:49:29:166 [14803][AppDelegate:682]: changingIdentifer:com.microsoft.teams2,currentAppBundleId:com.apple.controlcenter,changingSource:Optional("com.apple.inputmethod.SCIM.ITABC"),currentSource:Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:29:174 [14803][AppDelegate:642]: NSNotificationName(_rawValue: com.apple.Carbon.TISNotifySelectedKeyboardInputSourceChanged) nil 2024-02-21 17:49:29:174 [14803][AppDelegate:680]: changing, skip input source change notify. 2024-02-21 17:49:29:175 [14803][AppDelegate:682]: changingIdentifer:com.microsoft.teams2,currentAppBundleId:com.apple.controlcenter,changingSource:Optional("com.apple.inputmethod.SCIM.ITABC"),currentSource:Optional("com.apple.inputmethod.SCIM.ITABC") 2024-02-21 17:49:29:619 [14803][AppDelegate:365]: focusedUIElementChanged on Optional("<AXTextArea \"<AXUIElement 0x6000014cd050> {pid=90550}\" (pid=90550)>"); pid:[90550] info: [:] at com.microsoft.teams2.helper 2024-02-21 17:49:29:619 [14803][AppDelegate:365]: focusedUIElementChanged on Optional("<AXTextArea \"<AXUIElement 0x600001450000> {pid=90550}\" (pid=90550)>"); pid:[90545] info: [:] at com.microsoft.teams2 2024-02-21 17:49:29:619 [4281070][Util:306]: focus element: Optional(<AXTextArea "<AXUIElement 0x600001452be0> {pid=90550}" (pid=90550)>) 2024-02-21 17:49:29:620 [4281070][AppDelegate:497]: --- end for app[90550:Optional("com.microsoft.teams2.helper")] switch flag[0x0000600001a4bca0] is 10000000

hqch0708 commented 8 months ago

你好,我在这个issue上追加了一个comment,可以看一下不?还是会自动切换输入法。

顺便问一下,源代码是开源的吗?


发件人: leaves chen @.> 发送时间: 2024年2月20日 6:04 收件人: leaves615/KeyboardHolder @.> 抄送: hqch0708 @.>; Author @.> 主题: Re: [leaves615/KeyboardHolder] 在应用中会莫名其妙的切换输入法 (Issue #143)

Closed #143https://github.com/leaves615/KeyboardHolder/issues/143 as completed.

― Reply to this email directly, view it on GitHubhttps://github.com/leaves615/KeyboardHolder/issues/143#event-11857032543, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEGGUEBDGNYDYNLO67GVNV3YUQ4FFAVCNFSM6AAAAABCLUAIWOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHA2TOMBTGI2TIMY. You are receiving this because you authored the thread.

leaves615 commented 7 months ago

麻烦提供完整的日志文件和问题时间点 @hqch0708

hqch0708 commented 7 months ago

https://github.com/leaves615/KeyboardHolder/issues/143#issuecomment-1956136817 这就是。而且我用AppleScript 写了个基于system events来监听应用激活,发现在这个app自动切换输入法的时候,并没有应用被激活。

leaves615 commented 7 months ago

请提供完整的日志文件和问题时间点

hqch0708 commented 7 months ago

我更新到最新版1.12.12后。没有遇到这个问题了