aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--callbacks.c18
-rw-r--r--callbacks.h3
-rw-r--r--uzbl-core.c1
3 files changed, 22 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;
diff --git a/callbacks.h b/callbacks.h
index cc34618..3f318f2 100644
--- a/callbacks.h
+++ b/callbacks.h
@@ -190,5 +190,8 @@ gboolean
button_press_cb (GtkWidget* window, GdkEventButton* event);
gboolean
+button_release_cb (GtkWidget* window, GdkEventButton* event);
+
+gboolean
focus_cb(GtkWidget* window, GdkEventFocus* event, void *ud);
diff --git a/uzbl-core.c b/uzbl-core.c
index 0bbf445..73c4e79 100644
--- a/uzbl-core.c
+++ b/uzbl-core.c
@@ -1927,6 +1927,7 @@ create_browser () {
"signal::key-press-event", (GCallback)key_press_cb, NULL,
"signal::key-release-event", (GCallback)key_release_cb, NULL,
"signal::button-press-event", (GCallback)button_press_cb, NULL,
+ "signal::button-release-event", (GCallback)button_release_cb, NULL,
"signal::title-changed", (GCallback)title_change_cb, NULL,
"signal::selection-changed", (GCallback)selection_changed_cb, NULL,
"signal::load-progress-changed", (GCallback)progress_change_cb, NULL,