diff options
author | Rob <rob.manea@gmail.com> | 2009-11-08 02:14:09 +0100 |
---|---|---|
committer | Rob <rob.manea@gmail.com> | 2009-11-08 02:14:09 +0100 |
commit | 3fd1c34f8117e28a4b79251e01de9e3c9ad34c98 (patch) | |
tree | 77b6d0d72e2e438bd795a23ca6522dab0323d4f6 /callbacks.c | |
parent | 46714f503dacbb294d1e716de97cf1e2523f1424 (diff) |
added mouse button events
Diffstat (limited to 'callbacks.c')
-rw-r--r-- | callbacks.c | 18 |
1 files changed, 18 insertions, 0 deletions
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; |