Thanks for the response hackbod. However, the trackball left and right
events are not being handled by the G1--using the same code that works
in the emulator.

It would be nice to replace

"else if KeyEvent.KEYCODE_DPAD_LEFT"

with "onEvent.TRACKBALL_LEFT" or something similar, but it doesn't
work that way. I think you have to specify using the x-axis as a
relative position, and I'm not sure how it's done.

Thanks again.


On Oct 24, 6:04 pm, hackbod <[EMAIL PROTECTED]> wrote:
> The system automatically converts trackballe events to dpad events if
> nobody handles the trackball events themselves.  This of course means
> very quick down and up dpad events for each trackball movement, so if
> you are depending on someone holding a button down it won't work.
>
> You can watch trackball events yourself with View.onTrackballEvent().
>
> On Oct 24, 1:32 pm, Ed <[EMAIL PROTECTED]> wrote:
>
> > Just to clarify, the trackball left/right works in the emulator (using
> > the G1 skin), but not in the real phone. This is the relevant code
> > from the sample app:
>
> > // center/space -> fire
> >                     if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER
> >                             || keyCode == KeyEvent.KEYCODE_SPACE) {
> >                         setFiring(true);
> >                         return true;
> >                         // left/q -> left
> >                     } else if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT
> >                             || keyCode == KeyEvent.KEYCODE_Q) {
> >                         mRotating = -1;
> >                         return true;
> >                         // right/w -> right
> >                     } else if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT
> >                             || keyCode == KeyEvent.KEYCODE_W) {
> >                         mRotating = 1;
> >                         return true;
> >                         // up -> pause
> >                     } else if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
> >                         pause();
> >                         return true;
>
> > On Oct 24, 10:13 am, Ed <[EMAIL PROTECTED]> wrote:
>
> > > Hi all,
>
> > > I just installed the sample Lunar Lander app on my G1, only to
> > > discover that the inputs that worked on the emulator's D-Pad (left and
> > > right), no longer work. Is there a code snippet somewhere that can
> > > switch my apps that were developed with the D-Pad in mind to the
> > > scroll wheel thingie?
>
> > > Thanks.
>
>
--~--~---------~--~----~------------~-------~--~----~
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