Commit bf44f089 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

implemented default handler for key-release events, which checks for

Tue Jun 30 09:24:40 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
        default handler for key-release events, which checks for activation
        of GDK_RELEASE_MASK key bindings.

        * gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
parent 1d82cc2f
Tue Jun 30 09:24:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
default handler for key-release events, which checks for activation
of GDK_RELEASE_MASK key bindings.
* gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
......
Tue Jun 30 09:24:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
default handler for key-release events, which checks for activation
of GDK_RELEASE_MASK key bindings.
* gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
......
Tue Jun 30 09:24:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
default handler for key-release events, which checks for activation
of GDK_RELEASE_MASK key bindings.
* gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
......
Tue Jun 30 09:24:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
default handler for key-release events, which checks for activation
of GDK_RELEASE_MASK key bindings.
* gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
......
Tue Jun 30 09:24:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
default handler for key-release events, which checks for activation
of GDK_RELEASE_MASK key bindings.
* gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
......
Tue Jun 30 09:24:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
default handler for key-release events, which checks for activation
of GDK_RELEASE_MASK key bindings.
* gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
......
Tue Jun 30 09:24:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_key_release_event): implemented
default handler for key-release events, which checks for activation
of GDK_RELEASE_MASK key bindings.
* gdk/gdktypes.h (enum): added GDK_RELEASE_MASK to GdkModifierType.
Mon Jun 29 13:39:45 1998 Tim Janik <timj@gtk.org>
* gtk/gtkarrow.h: GtkType and macro fixups.
......
......@@ -441,7 +441,8 @@ typedef enum
GDK_BUTTON3_MASK = 1 << 10,
GDK_BUTTON4_MASK = 1 << 11,
GDK_BUTTON5_MASK = 1 << 12,
GDK_MODIFIER_MASK = 0x1fff
GDK_RELEASE_MASK = 1 << 13,
GDK_MODIFIER_MASK = 0x3fff
} GdkModifierType;
typedef enum
......
......@@ -186,6 +186,8 @@ static void gtk_widget_real_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint gtk_widget_real_key_press_event (GtkWidget *widget,
GdkEventKey *event);
static gint gtk_widget_real_key_release_event (GtkWidget *widget,
GdkEventKey *event);
static void gtk_widget_style_set (GtkWidget *widget,
GtkStyle *previous_style);
......@@ -720,7 +722,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->destroy_event = NULL;
klass->expose_event = NULL;
klass->key_press_event = gtk_widget_real_key_press_event;
klass->key_release_event = NULL;
klass->key_release_event = gtk_widget_real_key_release_event;
klass->enter_notify_event = NULL;
klass->leave_notify_event = NULL;
klass->configure_event = NULL;
......@@ -749,8 +751,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK, "hide", 0);
gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK, "show", 0);
gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK|GDK_RELEASE_MASK, "hide", 0);
gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK|GDK_RELEASE_MASK, "show", 0);
}
}
......@@ -1956,7 +1958,26 @@ gtk_widget_real_key_press_event (GtkWidget *widget,
if (!handled)
handled = gtk_bindings_activate (GTK_OBJECT (widget),
event->keyval, event->state);
event->keyval,
event->state);
return handled;
}
static gint
gtk_widget_real_key_release_event (GtkWidget *widget,
GdkEventKey *event)
{
gboolean handled = FALSE;
g_return_val_if_fail (widget != NULL, handled);
g_return_val_if_fail (GTK_IS_WIDGET (widget), handled);
g_return_val_if_fail (event != NULL, handled);
if (!handled)
handled = gtk_bindings_activate (GTK_OBJECT (widget),
event->keyval,
event->state | GDK_RELEASE_MASK);
return handled;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment