From 3fd1c34f8117e28a4b79251e01de9e3c9ad34c98 Mon Sep 17 00:00:00 2001 From: Rob Date: Sun, 8 Nov 2009 02:14:09 +0100 Subject: added mouse button events --- callbacks.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'callbacks.c') diff --git a/callbacks.c b/callbacks.c index c2b1455..8789104 100644 --- a/callbacks.c +++ b/callbacks.c @@ -474,6 +474,7 @@ gboolean button_press_cb (GtkWidget* window, GdkEventButton* event) { (void) window; gint context; + gchar *details; if(event->type == GDK_BUTTON_PRESS) { if(uzbl.state.last_button) @@ -489,6 +490,23 @@ button_press_cb (GtkWidget* window, GdkEventButton* event) { else if((context & WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT)) send_event(ROOT_ACTIVE, "button1", NULL); } + details = g_strdup_printf("Button%d", event->button); + send_event(KEY_PRESS, details, NULL); + g_free(details); + } + + return FALSE; +} + +gboolean +button_release_cb (GtkWidget* window, GdkEventButton* event) { + (void) window; + gchar *details; + + if(event->type == GDK_BUTTON_RELEASE) { + details = g_strdup_printf("Button%d", event->button); + send_event(KEY_RELEASE, details, NULL); + g_free(details); } return FALSE; -- cgit v1.2.3