···80808181 public boolean onTouchEvent(MotionEvent me)
8282 {
8383+ int x = (int) me.getX();
8484+ int y = (int) me.getY();
8585+8386 switch (me.getAction())
8487 {
8588 case MotionEvent.ACTION_CANCEL:
8689 case MotionEvent.ACTION_UP:
8787- touchHandler(0);
8888- break;
9090+ touchHandler(false, x, y);
9191+ return true;
8992 case MotionEvent.ACTION_MOVE:
9093 case MotionEvent.ACTION_DOWN:
9191- touchHandler(1);
9292- break;
9393-9494+ touchHandler(true, x, y);
9595+ return true;
9496 }
9595- pixelHandler((int)me.getX(), (int)me.getY());
9696- return true;
9797+9898+ return false;
9799 }
9810099101 public boolean onKeyDown(int keyCode, KeyEvent event)
···118120 }
119121120122 public native void set_lcd_active(int active);
121121- public native void pixelHandler(int x, int y);
122122- public native void touchHandler(int down);
123123+ public native void touchHandler(boolean down, int x, int y);
123124 public native boolean buttonHandler(int keycode, boolean state);
124125}
+6-15
firmware/target/hosted/android/button-android.c
···3939} last_state = STATE_UNKNOWN;
40404141/*
4242- * this writes in an interrupt-like fashion the last pixel coordinates
4343- * that the user pressed on the screen */
4444-JNIEXPORT void JNICALL
4545-Java_org_rockbox_RockboxFramebuffer_pixelHandler(JNIEnv*env, jobject this,
4646- int x, int y)
4747-{
4848- (void)env;
4949- (void)this;
5050- last_x = x;
5151- last_y = y;
5252-}
5353-5454-/*
5542 * this notifies us in an interrupt-like fashion whether the user just
5656- * began or stopped the touch action */
4343+ * began or stopped the touch action + where (pixel coordinates) */
5744JNIEXPORT void JNICALL
5845Java_org_rockbox_RockboxFramebuffer_touchHandler(JNIEnv*env, jobject this,
5959- int down)
4646+ bool down, int x, int y)
6047{
6148 (void)env;
6249 (void)this;
5050+6351 if (down)
6452 last_state = STATE_DOWN;
6553 else
6654 last_state = STATE_UP;
5555+5656+ last_x = x;
5757+ last_y = y;
6758}
68596960/*