[empathy] call-window: allow user to enter dtmf events using his keyboard
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] call-window: allow user to enter dtmf events using his keyboard
- Date: Mon, 9 Jul 2012 08:17:02 +0000 (UTC)
commit ada7b68f30ab88a3f142bf82cac790b98743ef23
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Jul 6 14:29:48 2012 +0200
call-window: allow user to enter dtmf events using his keyboard
Ideally we should stop sending the DTMF event when the key is released but we
can't easily do that in Gtk+; we'll have to write our own widget.
I'm going to give it a shot but this is already a nice improvement so we
shouldn't block on it.
https://bugzilla.gnome.org/show_bug.cgi?id=679396
src/empathy-call-window.c | 63 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 9cb96af..2b34f76 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -4047,6 +4047,7 @@ empathy_call_window_key_press_cb (GtkWidget *video_output,
GdkEventKey *event, EmpathyCallWindow *window)
{
EmpathyCallWindowPriv *priv = GET_PRIV (window);
+ gchar key = 0;
if (priv->is_fullscreen && event->keyval == GDK_KEY_Escape)
{
@@ -4056,6 +4057,68 @@ empathy_call_window_key_press_cb (GtkWidget *video_output,
return TRUE;
}
+ switch (event->keyval)
+ {
+ case GDK_KEY_KP_0:
+ case GDK_KEY_0:
+ key = '0';
+ 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 = '#';
+ break;
+ }
+
+ if (key != 0)
+ {
+ 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;
+ }
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]