From 964b6d2243fa1921543e48810f3064b9bd2d50d1 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 16 Apr 2021 17:58:22 +0200 Subject: [PATCH] Forward DOWN and UP separately for middle-click As a consequence of this change, the HOME button is now handled by Android on mouse released. This is consistent with the keyboard shortcut (MOD+h) behavior. PR #2259 Refs #2258 --- app/src/input_manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/input_manager.c b/app/src/input_manager.c index f6b1a96a..10af6e8b 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -647,6 +647,8 @@ input_manager_process_mouse_button(struct input_manager *im, bool down = event->type == SDL_MOUSEBUTTONDOWN; if (!im->forward_all_clicks) { + int action = down ? ACTION_DOWN : ACTION_UP; + if (control && event->button == SDL_BUTTON_RIGHT) { if (down) { press_back_or_turn_screen_on(im->controller); @@ -654,9 +656,7 @@ input_manager_process_mouse_button(struct input_manager *im, return; } if (control && event->button == SDL_BUTTON_MIDDLE) { - if (down) { - action_home(im->controller, ACTION_DOWN | ACTION_UP); - } + action_home(im->controller, action); return; }