aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-06 20:29:48 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-09 15:48:33 +0800
commitada7b68f30ab88a3f142bf82cac790b98743ef23 (patch)
tree0d6723e62d0f47b984dd4221c4f7be4311c530a1
parent761ef25a05361cdc8ec484e12898b3aedda94fe5 (diff)
downloadgsoc2013-empathy-ada7b68f30ab88a3f142bf82cac790b98743ef23.tar
gsoc2013-empathy-ada7b68f30ab88a3f142bf82cac790b98743ef23.tar.gz
gsoc2013-empathy-ada7b68f30ab88a3f142bf82cac790b98743ef23.tar.bz2
gsoc2013-empathy-ada7b68f30ab88a3f142bf82cac790b98743ef23.tar.lz
gsoc2013-empathy-ada7b68f30ab88a3f142bf82cac790b98743ef23.tar.xz
gsoc2013-empathy-ada7b68f30ab88a3f142bf82cac790b98743ef23.tar.zst
gsoc2013-empathy-ada7b68f30ab88a3f142bf82cac790b98743ef23.zip
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
-rw-r--r--src/empathy-call-window.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 9cb96afc3..2b34f7640 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;
}