From 5679d4d7e7fc69f2714d05334412cbd6cc88a289 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Mon, 18 Aug 2008 00:40:39 +0000 Subject: [PATCH] Debugging messages in event-context for mouse and keyboard interaction --- src/event-context.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ src/event-context.h | 2 ++ 2 files changed, 45 insertions(+) diff --git a/src/event-context.cpp b/src/event-context.cpp index b1c4f87ef..63f5b0f5d 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -1083,6 +1083,49 @@ ec_shape_event_attr_changed(Inkscape::XML::Node */*shape_repr*/, gchar const *na } +void +event_context_print_event_info(GdkEvent *event, bool print_return) { + switch (event->type) { + case GDK_BUTTON_PRESS: + g_print ("GDK_BUTTON_PRESS"); + break; + case GDK_2BUTTON_PRESS: + g_print ("GDK_2BUTTON_PRESS"); + break; + case GDK_3BUTTON_PRESS: + g_print ("GDK_3BUTTON_PRESS"); + break; + + case GDK_MOTION_NOTIFY: + g_print ("GDK_MOTION_NOTIFY"); + break; + case GDK_ENTER_NOTIFY: + g_print ("GDK_ENTER_NOTIFY"); + break; + + case GDK_LEAVE_NOTIFY: + g_print ("GDK_LEAVE_NOTIFY"); + break; + case GDK_BUTTON_RELEASE: + g_print ("GDK_BUTTON_RELEASE"); + break; + + case GDK_KEY_PRESS: + g_print ("GDK_KEY_PRESS: %d", get_group0_keyval(&event->key)); + break; + case GDK_KEY_RELEASE: + g_print ("GDK_KEY_RELEASE: %d", get_group0_keyval(&event->key)); + break; + default: + //g_print ("even type not recognized"); + break; + } + + if (print_return) { + g_print ("\n"); + } +} + /* Local Variables: mode:c++ diff --git a/src/event-context.h b/src/event-context.h index 6284b6e2c..1e95305e5 100644 --- a/src/event-context.h +++ b/src/event-context.h @@ -125,6 +125,8 @@ void ec_shape_event_attr_changed(Inkscape::XML::Node *shape_repr, gchar const *name, gchar const *old_value, gchar const *new_value, bool const is_interactive, gpointer const data); +void event_context_print_event_info(GdkEvent *event, bool print_return = true); + #endif -- 2.30.2