简体   繁体   English

Android是否检测到其他应用程序进行的常规键盘事件?

[英]Android detect general keyboard events made by other apps?

Is there a way to detect some general keyboard events made by other apps? 有没有办法检测其他应用程序产生的一些常规键盘事件? I understand that the specific keyboard events(eg key "b" pressed) should not be exposed due to security reason. 我了解出于安全原因,不应公开特定的键盘事件(例如,按下的键“ b”)。 But are general events like keyboard show/hide broadcast in any way? 但是,是否以任何方式广播了诸如键盘显示/隐藏之类的一般事件? I did some search but did not find it available. 我做了一些搜索,但没有找到可用的。

Keyboard show/hide is not an event you can listen for, not even in your own app (there are some hacky workarounds within your app, but it seems like you want to do this externally). 键盘显示/隐藏不是您可以收听的事件,即使在您自己的应用程序中也是如此(您的应用程序内部存在一些棘手的解决方法,但似乎您想在外部执行此操作)。 I don't believe keyboard events are broadcast in any way. 我认为键盘事件不会以任何方式广播。 They may be delivered to the current Activity window in focus (and to its Views), but I have seen nothing to suggest that they are broadcast across the system. 它们可能会被传递到当前“活动”窗口的焦点(及其视图)中,但是我看不出有任何建议可以在整个系统中进行广播。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM