Here is where I create and add the listener:
http://gamine.svn.sourceforge.net/viewvc/gamine/trunk/src/net/sf/gamine/common/InputStage.java?revision=8view=markup
It gets added in onStart(), which is called from the start() method of
/**
196* This inner class is used to monitor key events.
197*/
198 private class KeyListener implements View.OnKeyListener
199 {
200 public ArrayListKeyEvent currentEvents = new
ArrayListKeyEvent();
201 public ArrayListKeyEvent pendingEvents = new
Got it! In the process of messing around with this, I think I had
actually done all things I needed to, just never in the right
combination. For the record, the essential elements were:
1. Call setFocusable(true) on the View
2. Call setFocusableInTouchMode(true) on the View
3. Return false from
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
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
On Jan 16, 3:27 pm, Robert Green rbgrn@gmail.com wrote:
Remember to call setFocusableInTouchMode(true); in the view if you
want to receive focus and key/touch events.
I wasn't doing that. I just tried it though, and it didn't fix the
problem. Instead, it disabled the Back and Menu keys...
On Jan 16, 1: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.
Thanks, that was really helpful. After looking through your code for
a
That makes me think that you are now getting key events but aren't
handling them properly. If you always return true, the system will
not handle those keys anymore. I'm just shooting in the dark,
though. Is there any way you could post some code for me to see? I'm
pretty sure you need to
I went to http://code.google.com/p/cocos2d-android/ but I don't see
where to download the code. Where is it?
On Jan 17, 8:26 am, Robert Green rbgrn@gmail.com wrote:
That makes me think that you are now getting key events but aren't
handling them properly. If you always return true, the
9 matches
Mail list logo