Each trackball event represents a little bit of movement, possibly
part of a longer continuous movement by the user. They are not added
up for you.

You can see some neat code for collecting trackball movement from
unhandled trackball events and converting it into d-pad presses in
Android's ViewRoot class:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/view/ViewRoot.java;h=0c5d853ed4ddd37713f7dd3af38d6d3023929c01;hb=donut

You can see it handling issues like the user stopping for a while, or
going fast vs. slow, or changing direction.

On Jan 9, 6:45 am, Anton <[email protected]> wrote:
> Hi!
>
> I'm trying to figure out how to continuously update the coordinates of
> the trackball. Right now, I just want to write the values on change to
> TextViews to understand how it works.
>
> I've been looking at the onTrackballEvent. Right now, I assume that
> each event passed as an argument to it should be seen as a complete
> event, that is from the start of the trackball movement to the end. Is
> this correct?
> Because if so, the values of x and y will be the same during the
> execution of the onTrackballEvent body. If this would NOT be the case,
> I could just use a timer and update the values at a regular interval..
>
> So either I have to somehow interrupt the onTrackballEvent call and
> write the values, repeatedly over and over again while it is still
> moving, which seems weird, or...well this is pretty much were my
> Google search skills and Android knowledge comes to a halt.
>
> Any ideas/pointers are much appretiated. I'm sure this is a fairly
> simple question if you know your ways around the Android UI event
> handling methodology. I'm a happy Android beginner...and completely
> new to programming UI:s aswell.
>
> Thanks,
> Anton
-- 
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