summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/monitor_section.cc9
-rw-r--r--gtk2_ardour/monitor_section.h2
-rw-r--r--gtk2_ardour/public_editor.h1
-rw-r--r--gtk2_ardour/utils.cc6
-rw-r--r--gtk2_ardour/utils.h1
5 files changed, 19 insertions, 0 deletions
diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc
index 15840fc280..59801c767c 100644
--- a/gtk2_ardour/monitor_section.cc
+++ b/gtk2_ardour/monitor_section.cc
@@ -14,6 +14,7 @@
#include "ardour_ui.h"
#include "monitor_section.h"
+#include "public_editor.h"
#include "utils.h"
#include "volume_controller.h"
@@ -245,6 +246,7 @@ MonitorSection::MonitorSection (Session* s)
/* if torn off, make this a normal window */
_tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
_tearoff->tearoff_window().set_title (X_("Monitor"));
+ _tearoff->tearoff_window().signal_key_press_event().connect (sigc::mem_fun (*this, &MonitorSection::tearoff_key_press_event), false);
}
MonitorSection::~MonitorSection ()
@@ -255,6 +257,13 @@ MonitorSection::~MonitorSection ()
delete _tearoff;
}
+bool
+MonitorSection::tearoff_key_press_event (GdkEventKey* ev)
+{
+ cerr << "T key event\n";
+ return forward_key_press (ev);
+}
+
void
MonitorSection::populate_buttons ()
{
diff --git a/gtk2_ardour/monitor_section.h b/gtk2_ardour/monitor_section.h
index e12a94b089..87b619e7d0 100644
--- a/gtk2_ardour/monitor_section.h
+++ b/gtk2_ardour/monitor_section.h
@@ -104,4 +104,6 @@ class MonitorSection : public RouteUI
void solo_blink (bool);
bool cancel_solo (GdkEventButton*);
+
+ bool tearoff_key_press_event (GdkEventKey*);
};
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index 24a62e5113..e91f2911e3 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -360,6 +360,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
static PublicEditor* _instance;
friend bool relay_key_press (GdkEventKey*, Gtk::Window*);
+ friend bool forward_key_press (GdkEventKey*);
};
#endif // __gtk_ardour_public_editor_h__
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index b8d7569414..0bf7c5657f 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -520,6 +520,12 @@ relay_key_press (GdkEventKey* ev, Gtk::Window* win)
}
bool
+forward_key_press (GdkEventKey* ev)
+{
+ return PublicEditor::instance().on_key_press_event(ev);
+}
+
+bool
key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
{
GtkWindow* win = window.gobj();
diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h
index 9ee66729fc..ca1d751539 100644
--- a/gtk2_ardour/utils.h
+++ b/gtk2_ardour/utils.h
@@ -67,6 +67,7 @@ bool canvas_item_visible (ArdourCanvas::Item* item);
void set_color (Gdk::Color&, int);
bool relay_key_press (GdkEventKey* ev, Gtk::Window* win);
+bool forward_key_press (GdkEventKey* ev);
bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev);
bool possibly_translate_keyval_to_make_legal_accelerator (uint32_t& keyval);
uint32_t possibly_translate_legal_accelerator_to_real_key (uint32_t keyval);