summaryrefslogtreecommitdiff
path: root/gtk2_ardour/keyboard.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-09-05 23:09:10 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-09-05 23:09:10 +0000
commit222a85ca1074f30d9aea4a770900785d15420a84 (patch)
treecdca3566f684def1cebb4322dc21ed6a4674c836 /gtk2_ardour/keyboard.cc
parentb8e813c455f58150f9c2bd44b2a9d08b4393310b (diff)
optionally tie together editor+mixer display orders; provide GUI control for timecode-is-synced; make Ctrl-w close any dialog
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2422 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/keyboard.cc')
-rw-r--r--gtk2_ardour/keyboard.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc
index 90fea321de..cc94dc155f 100644
--- a/gtk2_ardour/keyboard.cc
+++ b/gtk2_ardour/keyboard.cc
@@ -48,13 +48,14 @@ uint32_t Keyboard::Shift = GDK_SHIFT_MASK;
uint32_t Keyboard::Alt = GDK_MOD1_MASK;
uint32_t Keyboard::Meta;
-Keyboard* Keyboard::_the_keyboard = 0;
+Keyboard* Keyboard::_the_keyboard = 0;
+Gtk::Window* Keyboard::current_window = 0;
+bool Keyboard::_some_magic_widget_has_focus = false;
/* set this to initially contain the modifiers we care about, then track changes in ::set_edit_modifier() etc. */
GdkModifierType Keyboard::RelevantModifierKeyMask;
-bool Keyboard::_some_magic_widget_has_focus = false;
void
Keyboard::magic_widget_grab_focus ()
@@ -199,6 +200,13 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
}
+ if (event->type == GDK_KEY_RELEASE && event->keyval == GDK_w && modifier_state_equals (event->state, Control)) {
+ if (current_window) {
+ current_window->hide ();
+ current_window = 0;
+ }
+ }
+
return false;
}
@@ -211,6 +219,7 @@ Keyboard::key_is_down (uint32_t keyval)
bool
Keyboard::enter_window (GdkEventCrossing *ev, Gtk::Window* win)
{
+ current_window = win;
return false;
}
@@ -236,6 +245,7 @@ Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* win)
cerr << "clearing current target\n";
}
state.clear ();
+ current_window = 0;
}
return false;