From 7c517f65660b0b6300cb69588ddb0a5d287f565a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 31 Jan 2017 18:08:44 +0100 Subject: mackie: check modifier bits for button AFTER identifying possibly remapped button ID --- libs/surfaces/mackie/mackie_control_protocol.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'libs/surfaces') diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index f57d3a7e8c..5ee8d31f85 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -1539,14 +1539,6 @@ MackieControlProtocol::handle_button_event (Surface& surface, Button& button, Bu return; } - if ((button_id != Button::Marker) && (modifier_state() & MODIFIER_MARKER)) { - marker_modifier_consumed_by_button = true; - } - - if ((button_id != Button::Nudge) && (modifier_state() & MODIFIER_NUDGE)) { - nudge_modifier_consumed_by_button = true; - } - DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Handling %1 for button %2 (%3)\n", (bs == press ? "press" : "release"), button.id(), Button::id_to_name (button.bid()))); @@ -1596,6 +1588,18 @@ MackieControlProtocol::handle_button_event (Surface& surface, Button& button, Bu } } + /* Now that we have the correct (maybe remapped) button ID, do these + * checks on it. + */ + + if ((button_id != Button::Marker) && (modifier_state() & MODIFIER_MARKER)) { + marker_modifier_consumed_by_button = true; + } + + if ((button_id != Button::Nudge) && (modifier_state() & MODIFIER_NUDGE)) { + nudge_modifier_consumed_by_button = true; + } + /* lookup using the device-INDEPENDENT button ID */ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("now looking up button ID %1\n", button_id)); -- cgit v1.2.3