From 0b7fe504dc93246957aee38c0d93ea1fa1580fab Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Thu, 13 Mar 2014 17:36:52 +0100 Subject: Add support for actions triggered by key combination Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6 Signed-off-by: Vojtech Bocek --- minuitwrp/events.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'minuitwrp/events.c') diff --git a/minuitwrp/events.c b/minuitwrp/events.c index 93c41f2d5..eb1490719 100644 --- a/minuitwrp/events.c +++ b/minuitwrp/events.c @@ -384,6 +384,7 @@ static int vk_modify(struct ev *e, struct input_event *ev) { static int downX = -1, downY = -1; static int discard = 0; + static int last_virt_key = 0; static int lastWasSynReport = 0; static int touchReleaseOnNextSynReport = 0; static int use_tracking_id_negative_as_touch_release = 0; // On some devices, type: 3 code: 39 value: -1, aka EV_ABS ABS_MT_TRACKING_ID -1 indicates a true touch release @@ -593,7 +594,11 @@ static int vk_modify(struct ev *e, struct input_event *ev) if (discard) { discard = 0; - return 1; + + // Send the keyUp event + ev->type = EV_KEY; + ev->code = last_virt_key; + ev->value = 0; } return 0; } @@ -651,6 +656,8 @@ static int vk_modify(struct ev *e, struct input_event *ev) ev->code = e->vks[i].scancode; ev->value = 1; + last_virt_key = e->vks[i].scancode; + vibrate(VIBRATOR_TIME_MS); // Mark that all further movement until lift is discard, -- cgit v1.2.3