KeyEvent and GLSurfaceView

by Mike » Sat, 28 Nov 2009 07:30:43 GMT


Sponsored Links
 Hi,

as soon as there's a GLSurfaceView in use, no other views receive any
KeyEvents.
MotionEvents however, are still working as expected.
Is there a way to prevent GLSurfaceView from swallowing all KeyEvents?

--



KeyEvent and GLSurfaceView

by Jack Palevich » Sat, 28 Nov 2009 09:10:47 GMT


 I don't think you have fully identified the problem you are
experiencing. If you read the source for GLSurfaceView, you will see
that it does nothing special to handle KeyEvents. So the problem you
are having is probably unrelated to GLSurfaceView.




--


Sponsored Links


KeyEvent and GLSurfaceView

by Lance Nanek » Sat, 28 Nov 2009 09:59:24 GMT


 Are you sure that the view you are expecting to receive key events has
focus?




--



KeyEvent and GLSurfaceView

by sixones » Sat, 28 Nov 2009 21:53:36 GMT


 If your catching the events on GLSurfaceView then return false to
indicate that the event has not been handled yet (otherwise the event
wont bubble), if not try disabling focusable and focusableInTouchMode.






--



Other Threads

1. dynamic scrollbars in web browser

Hi!

I don't know if this topic should be written here but I haven't found
a better place to post it.
This is more related to web programming for Android.
Well, the thing is when I try to display a DIV with the CSS property
"overflow" set to auto. This should show a scrollbar when the content
inside the DIV exceeds the size of the DIV.
You've got an example of this behaviour in this webpage:
http://www.domedia.org/oveklykken/css-div-scroll.php .
This works in all the web browsers I've tried (including Chrome and
new Internet Explorer Mobile) but not in Android's web browser. In
andoid, it only shows a blank bar instead of the scroll.
Is this a bug or a expected behaviour?

I hope this is the right place for my question.
Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~

2. A snapping Scrolling View

I'm using an ImageView to display an image twice as big as the screen.
I'm trying to make it scroll and snap like the home screen does, where
the user can drag the view left and right to see the two different
sides of the image. Can anyone at least point me in the right
direction on what method to be using.

I'm trying to use offsetLeftandRight, by the offset I get in my
OnTouchListener, but it just crashes. code below:

    // make a generic class to hold the click handler and touch
handler
    public OnTouchListener imageTouchHandler = new OnTouchListener()
    {

                @Override
                public boolean onTouch( View v, MotionEvent event )
                {
                        float curX = event.getX();
                        float curY = event.getY();
                        float press = event.getPressure();
                        int offset = 0;
                        int histSize;
                        int histX;
                        double d;

                        // if this is an actual move, spring the offset to the 
change in x
                        if( event.getAction() == MotionEvent.ACTION_MOVE )
                        {
                                histSize = event.getHistorySize();
                                histX = (int)event.getHistoricalX( histSize );
                                offset = (int)( histX - curX );
                                mainImage.offsetLeftAndRight( offset );
                        }

                        // also when the user is done moving, ACTION_UP, spring 
to the left
or right side
                        if( event.getAction() == MotionEvent.ACTION_UP )
                        {
                                offset = mainImage.getLeft();
                                if( offset < -160 )
                                {
                                        mainImage.offsetLeftAndRight( -320 );
                                }
                                else
                                {
                                        mainImage.offsetLeftAndRight( 0 );
                                }
                        }

                        return true;
                }

    };

--~--~---------~--~----~------------~-------~--~----~

3. Android on Samsung S5L8900

4. dynamically attaching Views

5. What 's the difference between ContentResolver and ContentValues?

6. how to reload libwebcore.so

7. WebView Horizontal orientation