Remember to call setFocusableInTouchMode(true); in the view if you want to receive focus and key/touch events.
On Jan 16, 3:19 pm, Philip <philip.dese...@gmail.com> wrote: > Not sure why this would happen but if you want to take a look at the > cocos2d for Android code I released last night, there are a few > examples on how it works. You will also notice the 20ms wait delay I > added there to avoid being flooded with motion events (pressure > sensivity changes are sent even if your finger doesn't move at 36fps > max.) Take a look at the project by downloading the code and let me > know if you can figure it out. I'd like to point you to the part where > it didn't work for me until I did this: you need to register your view > to get focus for keys and for motion in the create section. > > http://code.google.com/p/cocos2d-android/ > > Thanks, > > Philip > > On Jan 16, 11:50 am, Peter Eastman <peter.east...@gmail.com> wrote: > > > > > I'm having trouble getting a GLSurfaceView to respond to key and touch > > events. My entire UI consists of just the GLSurfaceView, which is set > > as the content view for the activity. I then call setOnKeyListener() > > and setOnTouchListener() on it, but neither listener ever gets > > called. I've tested both with the emulator using Android 2.0.1 and > > with a Nexus One using Android 2.1. Same result on both. > > > Any idea what I could be doing wrong? > > > Thanks! > > > Peter
-- 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