Android的虚拟键盘的KeyListener获取虚拟键盘键presses [英] Android Virtual Keyboard KeyListener for getting Virtual Keyboard key presses
问题描述
我想这对每个键preSS我需要改变计数器一些什么类似高音的事情,但问题是, OnEditorActionListener
只呼吁变化,而用户presses <大骨节病>输入骨节病>或<大骨节病>完成骨节病>键,请问我能找到一个解决此
I want that on each key press I require to change the Counter some what similar to Tweeter Thing but the issue is that OnEditorActionListener
only calls for the change while the user presses Enter or Done key, Please Can I Find a Resolution for this
推荐答案
您可以使用的 OnKeyListener
如果你真的想赶上按键。
You could use an OnKeyListener
if you do really want to catch keystrokes.
但是,如果你真正感兴趣的是什么,知道什么时候在的EditText
查看文本已经改变,你可能会发现更容易使用的 TextWatcher
。你会把你的code哪些更新根据的EditText
在<一个范围内的东西href="http://developer.android.com/reference/android/text/TextWatcher.html#afterTextChanged%28android.text.Editable%29"相对=nofollow> afterTextChanged()
方法。
However, if what you're really interested in is knowing when the text in an EditText
View has changed you might find it easier to use a TextWatcher
. You would put your code which updates something based on the context of the EditText
in the afterTextChanged()
method.
这篇关于Android的虚拟键盘的KeyListener获取虚拟键盘键presses的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!