From 2e9cb01bdad53b328799e57c9e8612758db006cd Mon Sep 17 00:00:00 2001 From: Ibrahim Awwal Date: Sat, 4 Jan 2014 12:38:26 -0800 Subject: Don't interpret ABS_MT_TOUCH_MAJOR == 0 as touch release On n8013 at least, this event is sometimes/often sent on touch start which causes touches to be randomly rejected and throws you back to the start screen. Touch releases still work fine for me, since it sends ABS_MT_TRACKING_ID == -1 for that purpose. Adds a flag TW_IGNORE_MAJOR_AXIS_0 to configure this behavior. Change-Id: I14bb036a2c2d4ee676b642c3ab297c55bb6c2084 --- minuitwrp/Android.mk | 4 ++++ minuitwrp/events.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'minuitwrp') diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk index 6e5f45f0b..8c8ffaa88 100644 --- a/minuitwrp/Android.mk +++ b/minuitwrp/Android.mk @@ -52,6 +52,10 @@ ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true) LOCAL_CFLAGS += -DBOARD_HAS_FLIPPED_SCREEN endif +ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true) +LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0 +endif + ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),) LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT) endif diff --git a/minuitwrp/events.c b/minuitwrp/events.c index 4368c1561..73369a2cc 100644 --- a/minuitwrp/events.c +++ b/minuitwrp/events.c @@ -395,10 +395,12 @@ static int vk_modify(struct ev *e, struct input_event *ev) case ABS_MT_TOUCH_MAJOR: //30 if (ev->value == 0) { +#ifndef TW_IGNORE_MAJOR_AXIS_0 // We're in a touch release, although some devices will still send positions as well e->mt_p.x = 0; e->mt_p.y = 0; touchReleaseOnNextSynReport = 1; +#endif } #ifdef _EVENT_LOGGING printf("EV: %s => EV_ABS ABS_MT_TOUCH_MAJOR %d\n", e->deviceName, ev->value); -- cgit v1.2.3