[gtk+] GtkEntry: Add a key binding for clearing the entry
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkEntry: Add a key binding for clearing the entry
- Date: Fri, 26 Sep 2014 14:30:14 +0000 (UTC)
commit 414bc202e78d7bbf976303ff81eae1fc6a09f659
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 26 10:29:10 2014 -0400
GtkEntry: Add a key binding for clearing the entry
Ctrl-u is a fine, well-established keybinding for this purpose,
lets just use it.
gtk/gtkentry.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index f35d54d..21403df 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -1978,6 +1978,16 @@ gtk_entry_class_init (GtkEntryClass *class)
gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, 0,
"backspace", 0);
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_u, GDK_CONTROL_MASK,
+ "move-cursor", 3,
+ GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS,
+ G_TYPE_INT, -1,
+ G_TYPE_BOOLEAN, FALSE);
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_u, GDK_CONTROL_MASK,
+ "delete-from-cursor", 2,
+ G_TYPE_ENUM, GTK_DELETE_PARAGRAPH_ENDS,
+ G_TYPE_INT, 1);
+
/* Make this do the same as Backspace, to help with mis-typing */
gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_SHIFT_MASK,
"backspace", 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]