From 1a3e85071f71e343ab05466e126a2fb9b4cd9fb4 Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Sat, 2 Jul 2022 22:21:55 -0700 Subject: [PATCH] Use mouse button release rather than press to activate a hotspot As described in issue #412, when using extended mouse coordinate (SGR) mode, the mouse button release sequence would be received by the BBS after the hotspot-activated menu option was executed and then that button release sequence possibly passed through to the a child script or program that didn't know how to handle or ignore it. To resolve this, the BBS now ignores ("eats") the mouse button *press* sequence and only acts upon the mouse button *release* sequence. This is more aligned with how button-clicks work in mouse-control/GUI applications anyway. --- src/sbbs3/inkey.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sbbs3/inkey.cpp b/src/sbbs3/inkey.cpp index 1a43c375ad..6471efbbc2 100644 --- a/src/sbbs3/inkey.cpp +++ b/src/sbbs3/inkey.cpp @@ -419,7 +419,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode) --y; lprintf(LOG_DEBUG, "SGR Mouse button (0x%02X) %s reported at: %u x %u" ,button, ch == 'M' ? "PRESS" : "RELEASE", x, y); - if(button == 0 && ch == 'M') { // Left-button press + if(button == 0 && ch == 'm') { // Left-button release list_node_t* node; for(node = mouse_hotspots.first; node != NULL; node = node->next) { struct mouse_hotspot* spot = (struct mouse_hotspot*)node->data; -- GitLab