Use PBD debugging code for keyboard debugging.
git-svn-id: svn://localhost/ardour2/branches/3.0@9019 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
90cbf4e708
commit
7cf24873f8
@ -614,13 +614,13 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
|
||||
#endif
|
||||
|
||||
|
||||
DEBUG_TRACE (DEBUG::Accelerators, string_compose ("Win = %1 Key event: code = %2 state = %3 special handling ? %4 magic widget focus %5? allow_activation ? %6\n",
|
||||
DEBUG_TRACE (DEBUG::Accelerators, string_compose ("Win = %1 Key event: code = %2 state = %3 special handling ? %4 magic widget focus ? %5 allow_activation ? %6\n",
|
||||
win,
|
||||
ev->keyval,
|
||||
ev->state
|
||||
<< special_handling_of_unmodified_accelerators
|
||||
<< Keyboard::some_magic_widget_has_focus()
|
||||
<< allow_activating));
|
||||
ev->state,
|
||||
special_handling_of_unmodified_accelerators,
|
||||
Keyboard::some_magic_widget_has_focus(),
|
||||
allow_activating));
|
||||
|
||||
/* This exists to allow us to override the way GTK handles
|
||||
key events. The normal sequence is:
|
||||
|
@ -34,9 +34,11 @@
|
||||
#include "pbd/file_utils.h"
|
||||
#include "pbd/search_path.h"
|
||||
#include "pbd/xml++.h"
|
||||
#include "pbd/debug.h"
|
||||
|
||||
#include "gtkmm2ext/keyboard.h"
|
||||
#include "gtkmm2ext/actions.h"
|
||||
#include "gtkmm2ext/debug.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
@ -45,9 +47,6 @@ using namespace Gtk;
|
||||
using namespace Gtkmm2ext;
|
||||
using namespace std;
|
||||
|
||||
#define KBD_DEBUG 1
|
||||
bool debug_keyboard = false;
|
||||
|
||||
guint Keyboard::edit_but = 3;
|
||||
guint Keyboard::edit_mod = GDK_CONTROL_MASK;
|
||||
guint Keyboard::delete_but = 3;
|
||||
@ -223,24 +222,18 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
|
||||
uint32_t keyval;
|
||||
bool ret = false;
|
||||
|
||||
#if 0
|
||||
cerr << "snoop widget " << widget << " key " << event->keyval << " type: " << event->type
|
||||
<< " state " << std::hex << event->state << std::dec
|
||||
<< " magic ? " << _some_magic_widget_has_focus
|
||||
<< endl;
|
||||
#endif
|
||||
|
||||
#if KBD_DEBUG
|
||||
if (debug_keyboard) {
|
||||
cerr << "snoop widget " << widget << " key " << event->keyval << " type: " << event->type
|
||||
<< endl;
|
||||
}
|
||||
#endif
|
||||
DEBUG_TRACE (
|
||||
DEBUG::Keyboard,
|
||||
string_compose (
|
||||
"Snoop widget %1 key %2 type %3 state %4 magic %5\n",
|
||||
widget, event->keyval, event->type, event->state, _some_magic_widget_has_focus
|
||||
)
|
||||
);
|
||||
|
||||
if (event->keyval == GDK_Shift_R) {
|
||||
keyval = GDK_Shift_L;
|
||||
|
||||
} else if (event->keyval == GDK_Control_R) {
|
||||
} else if (event->keyval == GDK_Control_R) {
|
||||
keyval = GDK_Control_L;
|
||||
|
||||
} else {
|
||||
@ -264,7 +257,7 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
|
||||
const AccelKey& ak (k->first);
|
||||
|
||||
if (keyval == ak.get_key() && (Gdk::ModifierType)((event->state & Keyboard::RelevantModifierKeyMask) | Gdk::RELEASE_MASK) == ak.get_mod()) {
|
||||
cerr << "Suppress auto repeat\n";
|
||||
DEBUG_TRACE (DEBUG::Keyboard, "Suppress auto repeat\n");
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
@ -288,8 +281,9 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
|
||||
if (keyval == ak.get_key() && (Gdk::ModifierType)((event->state & Keyboard::RelevantModifierKeyMask) | Gdk::RELEASE_MASK) == ak.get_mod()) {
|
||||
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (ts.first.c_str(), ts.second.c_str());
|
||||
if (act) {
|
||||
DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Activate %1 %2\n", ts.first, ts.second));
|
||||
act->activate();
|
||||
cerr << "use repeat, suppress other\n";
|
||||
DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Use repeat, suppress other\n", ts.first, ts.second));
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
@ -336,22 +330,16 @@ Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* /*win*/)
|
||||
if (ev) {
|
||||
switch (ev->detail) {
|
||||
case GDK_NOTIFY_INFERIOR:
|
||||
if (debug_keyboard) {
|
||||
cerr << "INFERIOR crossing ... out\n";
|
||||
}
|
||||
DEBUG_TRACE (DEBUG::Keyboard, "INFERIOR crossing ... out\n");
|
||||
break;
|
||||
|
||||
case GDK_NOTIFY_VIRTUAL:
|
||||
if (debug_keyboard) {
|
||||
cerr << "VIRTUAL crossing ... out\n";
|
||||
}
|
||||
DEBUG_TRACE (DEBUG::Keyboard, "VIRTUAL crossing ... out\n");
|
||||
/* fallthru */
|
||||
|
||||
default:
|
||||
if (debug_keyboard) {
|
||||
cerr << "REAL CROSSING ... out\n";
|
||||
cerr << "clearing current target\n";
|
||||
}
|
||||
DEBUG_TRACE (DEBUG::Keyboard, "REAL crossing ... out\n");
|
||||
DEBUG_TRACE (DEBUG::Keyboard, "Clearing current target\n");
|
||||
state.clear ();
|
||||
current_window = 0;
|
||||
}
|
||||
@ -546,22 +534,17 @@ Keyboard::load_keybindings (string path)
|
||||
|
||||
release_keys.clear ();
|
||||
|
||||
bool show_bindings = (getenv ("ARDOUR_SHOW_BINDINGS") != 0);
|
||||
|
||||
for (n = names.begin(), b = bindings.begin(), g = groups.begin(); n != names.end(); ++n, ++b, ++g) {
|
||||
stringstream s;
|
||||
s << "Action: " << *n << " Group: " << *g << " Binding: ";
|
||||
|
||||
if (show_bindings) {
|
||||
|
||||
cerr << "Action: " << (*n) << " Group: " << (*g) << " binding = ";
|
||||
|
||||
if ((*b).get_key() != GDK_VoidSymbol) {
|
||||
cerr << (*b).get_key() << " w/mod = " << hex << (*b).get_mod() << dec << " = " << (*b).get_abbrev();
|
||||
} else {
|
||||
cerr << "unbound";
|
||||
}
|
||||
|
||||
cerr << endl;
|
||||
if ((*b).get_key() != GDK_VoidSymbol) {
|
||||
s << b->get_key() << " w/mod " << hex << b->get_mod() << dec << " = " << b->get_abbrev () << "\n";
|
||||
} else {
|
||||
s << "unbound\n";
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::Bindings, s.str ());
|
||||
}
|
||||
|
||||
for (n = names.begin(), b = bindings.begin(), g = groups.begin(); n != names.end(); ++n, ++b, ++g) {
|
||||
|
@ -30,6 +30,7 @@ gtkmm2ext_sources = [
|
||||
'cell_renderer_pixbuf_toggle.cc',
|
||||
'choice.cc',
|
||||
'click_box.cc',
|
||||
'debug.cc',
|
||||
'dndtreeview.cc',
|
||||
'fastmeter.cc',
|
||||
'focus_entry.cc',
|
||||
|
Loading…
Reference in New Issue
Block a user