After reading answers to several similar questions* I did realize that onKeyListener() does not get key press events from a soft (virtual) keyboard. It gets them only from a hard (physical) keyboard. And the workaround would be either to use a TextWatcher or onKeyboardActionListener. I have following questions:
(1) Is there a way to be able to listen to key presses from any keyboard (soft or hard) by just implementing one listener? or basically a single API that works for both?
(2) TextWatcher or onKeyboardActionListener, unlike onKeyListener()'s onKey() method, do not pass the view that currently has focus (and in which the user is typing input). So, how do I get the currently focussed view if I were to use TextWatcher or onKeyboardActionListener? I need this to be able to set some properties on the EditText in which the user is keying their input, based on the input.
*Related questions: onKeyListener not working on virtual keyboard, onKeyListener not working with soft keyboard (Android), Android: why is my OnKeyListener() not called?
Thanks!