diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-11 22:07:47 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-11 22:07:47 +0000 |
commit | f7f9d6fdc40248b190ec9c6e1a886261d55777ae (patch) | |
tree | 080723e9dc35a66013b37acbafc67a6afa929302 /gtk2_ardour/keyboard.cc | |
parent | aa1f736a651376534acaa2268b65d42a3786fff7 (diff) |
merge from 2.0-ongoing by hand, minus key binding editor
git-svn-id: svn://localhost/ardour2/trunk@2539 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/keyboard.cc')
-rw-r--r-- | gtk2_ardour/keyboard.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc index 90fea321de..e6eaffefcb 100644 --- a/gtk2_ardour/keyboard.cc +++ b/gtk2_ardour/keyboard.cc @@ -48,14 +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 +199,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 +218,7 @@ Keyboard::key_is_down (uint32_t keyval) bool Keyboard::enter_window (GdkEventCrossing *ev, Gtk::Window* win) { + current_window = win; return false; } @@ -236,6 +244,7 @@ Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* win) cerr << "clearing current target\n"; } state.clear (); + current_window = 0; } return false; |