[gnome-bluetooth] wizard: Fix backspace, tab, etc. not working
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] wizard: Fix backspace, tab, etc. not working
- Date: Wed, 18 May 2011 16:51:05 +0000 (UTC)
commit df18e0dc72efee9400044a07a3c67aedae998d7f
Author: Bastien Nocera <hadess hadess net>
Date: Wed May 18 17:49:34 2011 +0100
wizard: Fix backspace, tab, etc. not working
In the custom PIN entry. We weren't eating all the events, including
escape, backspace, etc. instead of just the non-numerical printable
characters.
https://bugzilla.redhat.com/show_bug.cgi?id=692821
wizard/main.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index 637c489..e8bb400 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -604,11 +604,16 @@ set_page_search_complete (void)
gboolean
entry_custom_event (GtkWidget *entry, GdkEventKey *event)
{
+ gunichar c;
+
if (event->length == 0)
return FALSE;
- if ((event->keyval >= GDK_KEY_0 && event->keyval <= GDK_KEY_9) ||
- (event->keyval >= GDK_KEY_KP_0 && event->keyval <= GDK_KEY_KP_9))
+ /* Not a printable character? */
+ c = gdk_keyval_to_unicode (event->keyval);
+ if (c == 0 ||
+ g_unichar_iscntrl (c) ||
+ g_unichar_isdigit (c))
return FALSE;
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]