Try sleeping at the end of the event, such as Thread.sleep(30).
On Tue, Jul 20, 2010 at 11:50 PM, billconan <[email protected]> wrote: > Hello everyone. > > I'm working on a simple game: when you press a button on the screen, a > character will run to certain direction. > > it's easy to support keyboard input. but, some phone doesn't go with a > keyboard or even no a track ball. so I decided to draw a virtual "run" > key on the screen (with opengl). when the user press the virtual key, > i apply a velocity to the character. and when the user release the > key, i disable the velocity to stop the character. > > but there seems to be some touch event noisy. > > if my finger cannot press still, i will see millions of touch down and > touch up events, instead of a single long pressing. and occasionally, > my program captured the touch down event when i touch the screen, but > didn't capture touch up event. so my character will keep moving, even > no finger is on the screen. > > I'm wondering if there is some way to reduce the touch event noisy and > tell if the user is currently pressing on the screen, instead of only > getting an event when touch up and down happen. > > it seems the system ui can detect long pressing, for example when you > put a finger on one item of the list view widget, the entire item > turns to orange. > > i just don't know how to detect pressing in my opengl game. > > 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 -- http://developingthedream.blogspot.com/, http://diastrofunk.com, http://www.youtube.com/user/revoltingx, ~Isaiah 55:8-9 -- 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

