mackie: check modifier bits for button AFTER identifying possibly remapped button ID
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 Jan 2017 17:08:44 +0000 (18:08 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 Jan 2017 17:08:44 +0000 (18:08 +0100)
libs/surfaces/mackie/mackie_control_protocol.cc

index f57d3a7e8cd87390fd0b1ffcacfd24a369a23edf..5ee8d31f85f87a73948cde666548129607fbcb34 100644 (file)
@@ -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));