X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fkeyboard.cc;h=17390b8b4db79020fb24d82c5e855a55eaa95d4d;hb=30c08ba655330232767554c48bda1975bfb5628c;hp=3e187f15d3902e64c6ef60a24bc0d2857b203050;hpb=fb45ffea71d345ced0cfbb12b9dcd89ecb1e8dbf;p=ardour.git diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc index 3e187f15d3..17390b8b4d 100644 --- a/gtk2_ardour/keyboard.cc +++ b/gtk2_ardour/keyboard.cc @@ -35,6 +35,8 @@ #include "i18n.h" +using namespace PBD; + #define KBD_DEBUG 1 bool debug_keyboard = false; @@ -54,7 +56,7 @@ Keyboard* Keyboard::_the_keyboard = 0; /* set this to initially contain the modifiers we care about, then track changes in ::set_edit_modifier() etc. */ GdkModifierType Keyboard::RelevantModifierKeyMask = - GdkModifierType (GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD3_MASK); + GdkModifierType (GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK|GDK_MOD3_MASK); Keyboard::Keyboard () @@ -657,7 +659,7 @@ Keyboard::get_modifier_masks () } bool -Keyboard::enter_window (GdkEventCrossing *ev) +Keyboard::enter_window (GdkEventCrossing *ev, Gtk::Window* win) { switch (ev->detail) { case GDK_NOTIFY_INFERIOR: @@ -674,7 +676,7 @@ Keyboard::enter_window (GdkEventCrossing *ev) } bool -Keyboard::leave_window (GdkEventCrossing *ev) +Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* win) { switch (ev->detail) { case GDK_NOTIFY_INFERIOR: @@ -791,3 +793,14 @@ Keyboard::modifier_state_equals (guint state, ModifierMask mask) return (state & RelevantModifierKeyMask) == (guint) mask; } +Selection::Operation +Keyboard::selection_type (guint state) +{ + if (modifier_state_equals (state, Shift)) { + return Selection::Extend; + } else if (modifier_state_equals (state, Control)) { + return Selection::Toggle; + } else { + return Selection::Set; + } +}