Hi,
I now hooked my key processing into onKeyDown of class SoftKeyboard
instead of class InputMethodService.
SoftKeyboard filtered KeyEvent.KEYCODE_ENTER events before ;-)
The only problem now is that I always absorb DPAD_LEFT, DPAD_RIGHT,
DPAD_UP, DPAD_DOWN, DPAD_CENTER and KEYCODE_ENTER after the soft
keyboard was visible once. A quick fix to this issue is to declare
mShowInputRequested as protected and also check this variable in class
SoftKeyboard before doing the processing. Here a public method is
needed to decide if these key events should be processed by
SoftKeyboard. Method isInputViewShown() of class InputMethodService
didn't do the job. Or even better, SoftKeyboard's onKeyDown and
onKeyUp methods are only called when the SoftKeyboard is visible.

On 13 Mrz., 19:22, Dianne Hackborn <[email protected]> wrote:
> All key events -are- dispatched first to the IME.  There is a new
> pre-dispatch path that can be used by the application if needed to really do
> something before the IME, but afaik this is only used at this point by the
> auto complete text view to close its popup window when you hit back.
>
> On Fri, Mar 13, 2009 at 7:40 AM, Daniel 
> <[email protected]>wrote:
>
>
>
>
>
> > Hi,
> > our Android HW has no touchscreen and no keyboard. We just have DPAD
> > keys, menu, home and back.
> > To use Cupcake's soft keyboard I extended onKeyDown in
> > InputMethodService to push DPAD_LEFT, DPAD_RIGHT, DPAD_UP, DPAD_DOWN
> > and DPAD_CENTER events to onKeyDown of class KeyboardView. Now we can
> > control the SoftKeyboard with these keys. The problem is that we do
> > not get DPAD_CENTER as this key event is already consumed by the
> > focused text box when writing.
> > Sure, this is exactly what you want if you control the soft keyboard
> > by touch but there should be a way to tell InputMethodService to
> > consume all key events before the underlieing activity can do so.
> > Currently its the other way round I think.
> > We need the DPAD_CENTER key to press the selected key (at the moment
> > we do this with the menu button, but this is ugly).
> > Do you plan to further extend the InputMethodService for such
> > constrained environments? Would be very helpful ;-)
>
> --
> 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.  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-framework" 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-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to