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