tags:

views:

20

answers:

0

I am trying to use OnTouchEvent to manipulate some variables but it seems to run too slowly. It runs along with a lower level game engine and seems slugish. Is there a lower level way to listen for screen touch events?

    float x;
public boolean onTouchEvent(MotionEvent event)
{
      x = event.getX();

      int eventaction = event.getAction(); 
      switch (eventaction ) { 
            case MotionEvent.ACTION_DOWN:{ // touch on the screen event
                        if(x<50)
                        leftmove = true;
                     else
                         rightmove = true;
            }
            case MotionEvent.ACTION_MOVE:{ // move event

               break;
            }
            case MotionEvent.ACTION_UP:{  // finger up event
                leftmove = false;
                rightmove = false;
                break;

          }
      }

    return false;    
}