aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl-core.c
diff options
context:
space:
mode:
authorGravatar Robert Manea <gotmor@gmail.com>2009-09-06 23:38:00 +0200
committerGravatar Robert Manea <gotmor@gmail.com>2009-09-06 23:38:00 +0200
commite6cdd95b0f08de2a8b71df40f8cfedacbf8c58b5 (patch)
tree4b640f6035cd2b19c68efb48e084c7ab7cbaec82 /uzbl-core.c
parent207c292171f174d7ebf06fdb3258cb82d1b3a342 (diff)
Added KEY_RELEASE event
Diffstat (limited to 'uzbl-core.c')
-rw-r--r--uzbl-core.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/uzbl-core.c b/uzbl-core.c
index ad7dd56..d8179df 100644
--- a/uzbl-core.c
+++ b/uzbl-core.c
@@ -2304,7 +2304,7 @@ key_press_cb (GtkWidget* window, GdkEventKey* event)
(void) window;
if(event->type == GDK_KEY_PRESS)
- send_event(KEY_PRESS, gdk_keyval_name(event->keyval) );
+ send_event(KEY_PRESS, gdk_keyval_name(event->keyval));
if (event->type != GDK_KEY_PRESS ||
event->keyval == GDK_Page_Up ||
@@ -2329,6 +2329,16 @@ key_press_cb (GtkWidget* window, GdkEventKey* event)
return TRUE;
}
+gboolean
+key_release_cb (GtkWidget* window, GdkEventKey* event) {
+ (void) window;
+
+ if(event->type == GDK_KEY_RELEASE)
+ send_event(KEY_RELEASE, gdk_keyval_name(event->keyval));
+
+ return TRUE;
+}
+
void
run_keycmd(const gboolean key_ret) {
@@ -2437,6 +2447,7 @@ create_mainbar () {
gtk_misc_set_padding (GTK_MISC(g->mainbar_label), 2, 2);
gtk_box_pack_start (GTK_BOX (g->mainbar), g->mainbar_label, TRUE, TRUE, 0);
g_signal_connect (G_OBJECT (g->mainbar), "key-press-event", G_CALLBACK (key_press_cb), NULL);
+ g_signal_connect (G_OBJECT (g->mainbar), "key-release-event", G_CALLBACK (key_release_cb), NULL);
return g->mainbar;
}
@@ -2447,6 +2458,7 @@ create_window () {
gtk_widget_set_name (window, "Uzbl browser");
g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL);
g_signal_connect (G_OBJECT (window), "key-press-event", G_CALLBACK (key_press_cb), NULL);
+ g_signal_connect (G_OBJECT (window), "key-release-event", G_CALLBACK (key_release_cb), NULL);
g_signal_connect (G_OBJECT (window), "configure-event", G_CALLBACK (configure_event_cb), NULL);
return window;
@@ -2457,6 +2469,7 @@ create_plug () {
GtkPlug* plug = GTK_PLUG (gtk_plug_new (uzbl.state.socket_id));
g_signal_connect (G_OBJECT (plug), "destroy", G_CALLBACK (destroy_cb), NULL);
g_signal_connect (G_OBJECT (plug), "key-press-event", G_CALLBACK (key_press_cb), NULL);
+ g_signal_connect (G_OBJECT (plug), "key-release-event", G_CALLBACK (key_release_cb), NULL);
return plug;
}