Got it sorted.
It seems that just returning a standard BaseInputConnection isn't enough to
make the TextView editable. I needed to use the following subclass of
BaseInputConnection. Thanks Daniel :)
class MyInputConnection extends BaseInputConnection {
private SpannableStringBuilder
As I said in reply, I am overriding onCreateInputConnection(), but I am now
very sure that I am not setting the appropriate parameters in order to gain
editing abilities in my view. Here are the methods I am using at the
moment:
@Override
public InputConnection
Dianne, thank you for the clarification.
On Mon, Mar 28, 2011 at 5:33 AM, Dianne Hackborn hack...@android.comwrote:
Correct the IME does not send you raw keyboard events. It may not even
*have* raw keyboard events. Consider a handwriting IME, for example. That
is why the interaction with
On Mon, Mar 28, 2011 at 3:10 AM, Rich E reakina...@gmail.com wrote:
Can you explain to me how I can 'listen' to these calls? This is exactly
what I have been trying to achieve.
As has already been said, you need to override onCreateInputConnection() and
return your own interface.
--
Dianne
Thanks Pepijn,
I am overriding onCreateInputConnection (and onCheckIsTextEditor) although
neither of these give me per-keytap events - from what I have read,
onKeyDown/Up only give per-keytap event signals on hard keyboards, not soft.
I did find out about the TextWatcher class from
Harsh, this doesn't make any sense. You are suggesting that implementing
onKeyDown will cause onTouchEvent to receive touches from the keyboard? That
is not right. Also, the touches are not in my view, they are in the global
keyboard.
From what I have found in other posts, onKeyDown/Up does not
Harsh, it doesn't make sense that implementing onTouchEvent in a subclassed
View would return the soft keyboard's touch events (I want to know which key
is pressed on the soft keyboard, so I can draw it in my View).
Also, please email responses to the google group so other's can benefit from
this
Correct the IME does not send you raw keyboard events. It may not even
*have* raw keyboard events. Consider a handwriting IME, for example. That
is why the interaction with it is through InputConnection. Every
interaction you can have with the IME is basically through InputConnection.
Note
On Tue, Mar 22, 2011 at 6:14 PM, harsh chandel harshdchan...@gmail.comwrote:
try ontouch method
get x and y coordinate of the area clicked
and do as you want on the clicked event
harsh chandel, I am not sure that I understand you.. I am using
onTouchEvent() to trigger the keyboard
I've never done this myself, but from reading the InputMethodManager
documentation I get the impression you need to override
View#onCreateInputConnection(EditorInfo) in order to directly interact
with an IME.
Might be worth a shot...
Pepijn
On 24/03/2011 13:26, Rich E wrote:
On Tue, Mar
try ontouch method
get x and y coordinate of the area clicked
and do as you want on the clicked event
On Mar 21, 4:39 pm, Rich E reakina...@gmail.com wrote:
Hi,
I'm trying to figure out how to capture keyboard input from a View, without
subclassing EditText or something similar (the reason
11 matches
Mail list logo