It is more easy than that. If you implement onTrackBallEvent in your
activity and you return true; The event is consumed by you, otherwise
it also triggers a onKeyUp event with a DPAD keycode.

regards,

Lucas

On Jan 11, 7:39 am, blake <blake.me...@gmail.com> wrote:
> Dianne!  Brilliant answer!  Thank you very much!
>
> Pressing my luck, where does that translation happen?  RootView?
> Activity?
>
> Many thanks!
>   -blake
>
> On Jan 10, 6:23 pm, "Dianne Hackborn" <hack...@android.com> wrote:
>
> > The framework translates raw trackball events into DPAD events if nobody
> > consumes the trackball event.
>
> > At this time Android only supports devices that have a touch screen.  The
> > trackball is optional, and can be replaced by a DPAD.
>
> > On Sat, Jan 10, 2009 at 5:21 PM, blake <blake.me...@gmail.com> wrote:
>
> > > mmmm... it appears that I was mistaken.  Both trackball movement and
> > > screen taps generate MotionEvents.  They are delivered completely
> > > differently, though Trackball events through dispatchTrackballEvent,
> > > and touch events through dispatchTouchEvent.
>
> > > I remain mystified by how the trackball is handled.  It begins to look
> > > as if it generates MotionEvents exactly as the touch screen does.
> > > Presumably, clicking it generates a KEYCODE_DPAD_CENTER event.  How do
> > > you generate a KEYCODE_DPAD_UP on, e.g., a G1?
>
> > > -blake
>
> > > On Jan 10, 4:40 pm, blake <blake.me...@gmail.com> wrote:
> > > > I notice that TrackballEvents are different that MotionEvents, and it
> > > > makes me wonder what happens on a device that does not support a touch
> > > > screen.
>
> > > > Suppose I have an Etch-a-Sketch application, that allows me to do
> > > > crude drawings on my screen.  With the G1 phone, I just watch for
> > > > MotionEvents and draw them.
>
> > > > Can anyone confirm (or deny) that, on a device that doesn't have a
> > > > touch screen, my application will not work?  Or, possibly, might
> > > > trackball events appear as MotionEvents, on such a device.
>
> > > > -blake
>
> > --
> > 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.  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
-~----------~----~----~----~------~----~------~--~---

Reply via email to