onKeyListener不工作的软键盘(安卓) [英] onKeyListener not working with soft keyboard (Android)

查看:250
本文介绍了onKeyListener不工作的软键盘(安卓)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用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.

这篇关于onKeyListener不工作的软键盘(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆