summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-03-26 13:56:50 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2018-03-26 13:56:50 -0400
commitddfc37e42a27e31f6916100c5bbc3f04ba104522 (patch)
treef3e24c9b1868d9dac0f2e33f041ec5ebca8530e0
parenta4df6e565b5ac3c017ce73a1198666e4dc4b6caa (diff)
fix binding to long-press for User button on FaderPort
-rw-r--r--libs/surfaces/faderport/faderport.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index 962678735e..9896997640 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -364,6 +364,9 @@ FaderPort::button_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
break;
case User:
bs = UserDown;
+ if (tb->value) {
+ start_press_timeout (button, id);
+ }
break;
case FaderTouch:
fader_is_touched = tb->value;
@@ -966,6 +969,13 @@ FaderPort::Button::set_action (string const& name, bool when_pressed, FaderPort:
if (name.empty()) {
on_release.erase (bs);
} else {
+ if (id == User) {
+ /* if the binding is for the User button, we
+ need to store the button state as it will be
+ seen on button release, which will include UserDown.
+ */
+ bs = FaderPort::ButtonState (bs|UserDown);
+ }
DEBUG_TRACE (DEBUG::FaderPort, string_compose ("set button %1 to action %2 on release + %3%4%5\n", id, name, bs));
todo.action_name = name;
on_release[bs] = todo;