[empathy] call-window: use gdk_keyval_to_unicode()
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] call-window: use gdk_keyval_to_unicode()
- Date: Mon, 9 Jul 2012 08:17:17 +0000 (UTC)
commit 20c864a24dce1b0f2781ea1cbbf75ce3d8c34495
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Mon Jul 9 10:11:57 2012 +0200
call-window: use gdk_keyval_to_unicode()
https://bugzilla.gnome.org/show_bug.cgi?id=679396
src/empathy-call-window.c | 79 ++++++++++++--------------------------------
1 files changed, 22 insertions(+), 57 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 2b34f76..e8c3912 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -4047,7 +4047,7 @@ empathy_call_window_key_press_cb (GtkWidget *video_output,
GdkEventKey *event, EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
- gchar key = 0;
+ gchar key;
if (priv->is_fullscreen && event->keyval == GDK_KEY_Escape)
{
@@ -4057,69 +4057,34 @@ empathy_call_window_key_press_cb (GtkWidget *video_output,
return TRUE;
}
- switch (event->keyval)
+ key = gdk_keyval_to_unicode (event->keyval);
+ switch (key)
{
- case GDK_KEY_KP_0:
- case GDK_KEY_0:
- key = '0';
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '*':
+ case '#':
break;
- case GDK_KEY_KP_1:
- case GDK_KEY_1:
- key = '1';
- break;
- case GDK_KEY_KP_2:
- case GDK_KEY_2:
- key = '2';
- break;
- case GDK_KEY_KP_3:
- case GDK_KEY_3:
- key = '3';
- break;
- case GDK_KEY_KP_4:
- case GDK_KEY_4:
- key = '4';
- break;
- case GDK_KEY_KP_5:
- case GDK_KEY_5:
- key = '5';
- break;
- case GDK_KEY_KP_6:
- case GDK_KEY_6:
- key = '6';
- break;
- case GDK_KEY_KP_7:
- case GDK_KEY_7:
- key = '7';
- break;
- case GDK_KEY_KP_8:
- case GDK_KEY_8:
- key = '8';
- break;
- case GDK_KEY_KP_9:
- case GDK_KEY_9:
- key = '9';
- break;
- case GDK_KEY_asterisk:
- case GDK_KEY_KP_Multiply:
- key = '*';
- break;
- case GDK_KEY_numbersign:
- case GDK_KEY_KP_Add:
- key = '#';
+ default:
+ return TRUE;
break;
}
- if (key != 0)
- {
- gtk_toggle_tool_button_set_active (
- GTK_TOGGLE_TOOL_BUTTON (priv->dialpad_button), TRUE);
+ gtk_toggle_tool_button_set_active (
+ GTK_TOGGLE_TOOL_BUTTON (priv->dialpad_button), TRUE);
- empathy_dialpad_widget_press_key (
- EMPATHY_DIALPAD_WIDGET (priv->dtmf_panel), key);
- return TRUE;
- }
+ empathy_dialpad_widget_press_key (
+ EMPATHY_DIALPAD_WIDGET (priv->dtmf_panel), key);
- return FALSE;
+ return TRUE;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]