recovery: ui: Support hardware virtual keys
* Also swipe left -> KEY_BACK
Change-Id: I6bd8054485d680df35abb86cb79f1dda683e4459
diff --git a/minui/events.cpp b/minui/events.cpp
index 0eb8f72..c0f64f1 100644
--- a/minui/events.cpp
+++ b/minui/events.cpp
@@ -237,7 +237,8 @@
}
}
-void ev_iterate_touch_inputs(const std::function<void(int)>& key_detected) {
+void ev_iterate_touch_inputs(const std::function<void(int)>& touch_device_detected,
+ const std::function<void(int)>& key_detected) {
for (size_t i = 0; i < g_ev_dev_count; ++i) {
// Use unsigned long to match ioctl's parameter type.
unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)] = {}; // NOLINT
@@ -253,6 +254,8 @@
continue;
}
+ touch_device_detected(ev_fdinfo[i].fd);
+
for (int key_code = 0; key_code <= KEY_MAX; ++key_code) {
if (test_bit(key_code, key_bits)) {
key_detected(key_code);