- Changed IO's vector<Port*>'s to PortList
[ardour.git] / gtk2_ardour / keyboard.cc
index 3e187f15d3902e64c6ef60a24bc0d2857b203050..17390b8b4db79020fb24d82c5e855a55eaa95d4d 100644 (file)
@@ -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;
+       }
+}