summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-03-09 19:57:21 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-03-13 17:37:03 +0100
commit30fa335a853d20c22fb250ecbe7a6c585a65a7de (patch)
tree09db5d77e8321f9925f0397cd85fc5b030721281
parentMake TWRP compile for x86-64 CPU target (diff)
downloadandroid_bootable_recovery-30fa335a853d20c22fb250ecbe7a6c585a65a7de.tar
android_bootable_recovery-30fa335a853d20c22fb250ecbe7a6c585a65a7de.tar.gz
android_bootable_recovery-30fa335a853d20c22fb250ecbe7a6c585a65a7de.tar.bz2
android_bootable_recovery-30fa335a853d20c22fb250ecbe7a6c585a65a7de.tar.lz
android_bootable_recovery-30fa335a853d20c22fb250ecbe7a6c585a65a7de.tar.xz
android_bootable_recovery-30fa335a853d20c22fb250ecbe7a6c585a65a7de.tar.zst
android_bootable_recovery-30fa335a853d20c22fb250ecbe7a6c585a65a7de.zip
Diffstat (limited to '')
-rw-r--r--gui/Android.mk7
-rw-r--r--gui/gui.cpp17
2 files changed, 22 insertions, 2 deletions
diff --git a/gui/Android.mk b/gui/Android.mk
index 81cd5597d..afaa5da9c 100644
--- a/gui/Android.mk
+++ b/gui/Android.mk
@@ -39,7 +39,10 @@ LOCAL_MODULE := libguitwrp
#TWRP_EVENT_LOGGING := true
ifeq ($(TWRP_EVENT_LOGGING), true)
-LOCAL_CFLAGS += -D_EVENT_LOGGING
+ LOCAL_CFLAGS += -D_EVENT_LOGGING
+endif
+ifneq ($(TW_USE_KEY_CODE_TOUCH_SYNC),)
+ LOCAL_CFLAGS += -DTW_USE_KEY_CODE_TOUCH_SYNC=$(TW_USE_KEY_CODE_TOUCH_SYNC)
endif
ifneq ($(TW_NO_SCREEN_BLANK),)
@@ -49,7 +52,7 @@ ifneq ($(TW_NO_SCREEN_TIMEOUT),)
LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
endif
ifeq ($(HAVE_SELINUX), true)
-LOCAL_CFLAGS += -DHAVE_SELINUX
+ LOCAL_CFLAGS += -DHAVE_SELINUX
endif
ifeq ($(TW_OEM_BUILD), true)
LOCAL_CFLAGS += -DTW_OEM_BUILD
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 3aef983ab..c755a9848 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -342,18 +342,22 @@ void InputHandler::process_EV_ABS(input_event& ev)
if (ev.code == 0)
{
+#ifndef TW_USE_KEY_CODE_TOUCH_SYNC
if (state == AS_IN_ACTION_AREA)
{
LOGEVENT("TOUCH_RELEASE: %d,%d\n", x, y);
PageManager::NotifyTouch(TOUCH_RELEASE, x, y);
}
touch_status = TS_NONE;
+#endif
}
else
{
if (!touch_status)
{
+#ifndef TW_USE_KEY_CODE_TOUCH_SYNC
doTouchStart();
+#endif
}
else
{
@@ -403,6 +407,13 @@ void InputHandler::process_EV_KEY(input_event& ev)
kb->KeyUp(KEY_BACK);
} else if (ev.value != 0) {
// This is a key press
+#ifdef TW_USE_KEY_CODE_TOUCH_SYNC
+ if (ev.code == TW_USE_KEY_CODE_TOUCH_SYNC) {
+ LOGEVENT("key code %i key press == touch start %i %i\n", TW_USE_KEY_CODE_TOUCH_SYNC, x, y);
+ doTouchStart();
+ return;
+ }
+#endif
if (kb->KeyDown(ev.code)) {
// Key repeat is enabled for this key
key_status = KS_KEY_PRESSED;
@@ -417,6 +428,12 @@ void InputHandler::process_EV_KEY(input_event& ev)
kb->KeyUp(ev.code);
key_status = KS_NONE;
touch_status = TS_NONE;
+#ifdef TW_USE_KEY_CODE_TOUCH_SYNC
+ if (ev.code == TW_USE_KEY_CODE_TOUCH_SYNC) {
+ LOGEVENT("key code %i key release == touch release %i %i\n", TW_USE_KEY_CODE_TOUCH_SYNC, x, y);
+ PageManager::NotifyTouch(TOUCH_RELEASE, x, y);
+ }
+#endif
}
}