u need to set this view focus if u want handle the events from event
queue

setFocusable(true);

On Aug 31, 10:58 pm, tylik <dmitry.ty...@motorola.com> wrote:
> I was in a similar situation with another view and had to override
> dispatchKeyEvent(). You can try and see if it helps
> --
> Best regards,
> Dmitry
>
> On Aug 29, 10:43 am, Gameboy <r59...@gmail.com> wrote:
>
>
>
> > I'm trying to use SDK 1.5 for developing app on opengl feautre, but
> > GLSurfaceView does not invoke OnKeyDown(...) any more, what's reason?
> > App runs on windows emulator.
>
> > There is sample code in SDK document:
>
> >  class MyGLSurfaceView extends GLSurfaceView {
>
> >      private MyRenderer mMyRenderer;
>
> >      public void start() {
> >          mMyRenderer = ...;
> >          setRenderer(mMyRenderer);
> >      }
>
> >      public boolean onKeyDown(int keyCode, KeyEvent event) {
> >          if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
> >              queueEvent(new Runnable() {
> >                  // This method will be called on the rendering
> >                  // thread:
> >                  public void run() {
> >                      mMyRenderer.handleDpadCenter();
> >                  }});
> >              return true;
> >          }
> >          return super.onKeyDown(keyCode, event);
> >      }
> >  }

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to