onKeyListener不工作的软键盘(安卓)键盘、工作、onKeyListener

由网友(第一眼心动)分享简介:我使用onKeyListener得到onKey事件。它工作正常与普通键盘。不过,这并不与软键盘工作。我只能够得到的数字和字母不是事件onKey。有没有什么解决办法来解决呢?任何形式的帮助将大大AP preciated。 I am using onKeyListener to get the onKey events....

我使用onKeyListener得到onKey事件。它工作正常与普通键盘。不过,这并不与软键盘工作。我只能够得到的数字和字母不是事件onKey。有没有什么解决办法来解决呢?任何形式的帮助将大大AP preciated。

I am using onKeyListener to get the onKey events. It works fine with the normal keyboard. But it does not work with soft keyboard. I am only able to get onKey events for numerics and not alphabets. Is there any workaround to solve this? Any kind of help will be greatly appreciated.

推荐答案

我不相信一个OnKeyListener被调用所有的软件键盘。它是与软件键盘是一个输入法装置和IME的设备可能是做的比键盘等。这似乎让onKeyListener pretty的无用的,虽然不多,因为它仅适用于手机硬件键盘。我工作围绕这个问题最近在我的活动使用 TextWatcher 上的EditText领域,而不是使用OnKeyListener

I don't believe an OnKeyListener gets called at all with the software keyboard. It has something to do with the software keyboard being an IME device and IME devices possibly being things other than keyboards. It seems to make onKeyListener pretty much useless though, since it only works on phones with hardware keyboards. I worked around this issue recently by using TextWatcher on the EditText field in my Activity instead of using OnKeyListener.

阅读全文

相关推荐

最新文章