Re: [android-developers] Transparent InputConnection?

2011-04-04 Thread Dimitry Golubovsky
Dianne,

On Wed, Mar 30, 2011 at 12:41 PM, Dianne Hackborn  wrote:
> I don't understand what you are asking.  If you want to not let any editing
> to happen, just implement an InputConnection that doesn't do anything.  If
> there is something different than that which you are looking for...  well
> you'll just need to implement the operations on InputConnection to whatever
> it is you want.

Indeed, returning new BaseInputConnection from onCreateInputConnection
did the trick. Both digits and backspace now work as needed.

Thank you.

-- 
Dimitry Golubovsky

Anywhere on the Web

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


Re: [android-developers] Transparent InputConnection?

2011-03-30 Thread Dimitry Golubovsky
Dianne,

Since the Squeak VM which I am porting to Android takes care of
editing text itself (by means of Morphic widgets), I just need to pass
events from every touch of soft keyboard to the View in focus. No
special handling for backspace/numbers/nothing.

The input connection I currently have (inherited from the parent
project, I haven't touched it yet) is at its current revision, here:

http://tinyurl.com/4628qth

With this implementation I have working input for letters, and some
special characters, but no input for digits and backspace.

There also is a code in the View implementation (also inherited):

public boolean onCheckIsTextEditor() {
   return true;
}

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
   if(!onCheckIsTextEditor()) return null;
   return new SqueakInputConnection(this, false);
}

Should I just return null from onCreateInputConnection (or return
false from onCheckIsTextEditor)?

Thank you.

On Wed, Mar 30, 2011 at 12:41 PM, Dianne Hackborn  wrote:
> I don't understand what you are asking.  If you want to not let any editing
> to happen, just implement an InputConnection that doesn't do anything.  If
> there is something different than that which you are looking for...  well
> you'll just need to implement the operations on InputConnection to whatever
> it is you want.
> You say all you need is to pass a key event...  but the point of
> InputConnection is to *not* operate in key events.  If you just want raw key
> events, don't implement an InputConnection.  (There is compatibility code
> that turns operations into raw key events for apps that don't support input
> connections.)

-- 
Dimitry Golubovsky

Anywhere on the Web

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


Re: [android-developers] Transparent InputConnection?

2011-03-30 Thread Dianne Hackborn
I don't understand what you are asking.  If you want to not let any editing
to happen, just implement an InputConnection that doesn't do anything.  If
there is something different than that which you are looking for...  well
you'll just need to implement the operations on InputConnection to whatever
it is you want.

You say all you need is to pass a key event...  but the point of
InputConnection is to *not* operate in key events.  If you just want raw key
events, don't implement an InputConnection.  (There is compatibility code
that turns operations into raw key events for apps that don't support input
connections.)

On Wed, Mar 30, 2011 at 6:49 AM, Dmitry Golubovsky wrote:

> Hi,
>
> Is there an example of/tutorial on maximally transparent subclass of
> BaseInputConnection? Android 2.0 if that matters.
>
> All I need is to pass a key event to the target view on any alpha or
> digit or special character soft key pressed, bypassing any built-in
> text editing capabilities.
>
> This is perhaps a generalization of my earlier question about
> KEYCODE_DEL (I got a suggestion for this one on another forum that the
> problem lies in the input connection), but it looks like input of
> digits does not work properly either: I just want to have a
> transparent input method.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en