public boolean onTouchEvent(MotionEvent event) { TEManagerInput inputManager = TEManagerInput.sharedManager(); int pointerId; float x; float y; final int actionId = event.getAction(); TEInputTouch touch; final int pointerCount = event.getPointerCount(); for (int i = 0; i < pointerCount; ++i) { pointerId = event.getPointerId(i); x = event.getX(pointerId); y = mHeight - event.getY(pointerId); switch (actionId) { case MotionEvent.ACTION_DOWN: touch = new TEInputTouch(pointerId, x, y); inputManager.beginTouch(touch); break; case MotionEvent.ACTION_MOVE: touch = new TEInputTouch(pointerId, x, y); inputManager.moveTouch(touch); break; case MotionEvent.ACTION_UP: touch = new TEInputTouch(pointerId, x, y); inputManager.endTouch(touch); break; default: Log.v("info", "Couldn't identify " + String.valueOf(actionId)); break; } } return false; }
public boolean onKeyUp(int keyCode, KeyEvent event) { TEManagerInput inputManager = TEManagerInput.sharedManager(); inputManager.endKeyPress(keyCode); return false; }