If possible, it is better to add an appropriate watcher/filter on the text
view, and do your specialization as a result of the text being modified.
This will work for both hard keys and soft edits.

On Sun, Aug 23, 2009 at 12:05 PM, Hazam <[email protected]>wrote:

>
> Hi guys,
> I just got back from holidays :)
> this is the hack
>
> @Override
> public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
>        InputConnection ic = super.onCreateInputConnection(outAttrs);
>        InputConnectionWrapper icw = new InputConnectionWrapper(ic, false) {
>
>                public boolean commitText(CharSequence text, int
> newCursorPosition)
> {
>                        //TODO text is the new inserted text, return if the
> text is ok or
> not
>                }
>        };
>        return icw;
> }
>
> The point is, one should use InputFilter objects on a TextField as
> much as possible,
> but in the very special case that you have to react to the key pressed
> on the vitual keyboard
> to do something more custom, that's the only way I found.
>
> Hope this helps
>
> On Aug 6, 11:09 pm, Hong <[email protected]> wrote:
> > Hi Emanuele,
> >
> > I'm interested in knowing your solution as well ;)  A small favor on
> > my tips to you... please...
> >
> > Thanks
> >
> > Hong
> >
> >
> >
> > On Fri, Jul 31, 2009 at 10:48 AM, Azhdar<[email protected]> wrote:
> >
> > > Hi Hazam,
> >
> > > could you show us more in detail how you do that ?
> >
> > > Thank you !
> >
> > > Azhdar
> >
> > > On Jul 10, 3:23 pm, Hazam <[email protected]> wrote:
> > >> Hi Hong,
> > >> thanks for your reply.
> > >> I tried that but to no avail.
> > >> The reason seems to be that clicks and actions fromvirtualkeyboard
> > >> do not follow the same
> > >> path that normal key and touch events do.
> > >> The get tunneled in an InputConnection, and things get REALLY
> > >> difficult for me to understand fully.
> > >> So i just override onCreateInputConnection and return a
> > >> BaseInputConnection and now it works.
> > >> thanks again for the reply,
> >
> > >> -Emanuele
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to