[Telepathy] swapping return/ctrl-return keybindings

Brian J. Murrell brian at interlinx.bc.ca
Mon Mar 16 22:22:29 PDT 2009


I'm trying to swap the return and ctrl-return keybindings the same way I 
can with pidgin.  I put this in my ~/.gtkrc-2.0 file:

binding "my-empathy-bindings"
{
# enter inserts a newline
	bind "Return" { "insert-at-cursor" ("\n") }
# ctrl-enter sends message
 	bind "<ctrl>Return" { "message_send" () }
}
  
widget "*empathy_input_text_view" binding "my-empathy-bindings"

But the input_text_view widget is not named you might say.  I have 
applied this patch and rebuilt:

--- empathy-2.25.92.orig/libempathy-gtk/empathy-chat.c
+++ empathy-2.25.92/libempathy-gtk/empathy-chat.c
@@ -1311,6 +1311,7 @@
                                              "left-margin", 2,
                                              "wrap-mode", GTK_WRAP_WORD_CHAR,
                                              NULL);
+       gtk_widget_set_name(chat->input_text_view, "empathy_input_text_view");
        g_signal_connect (chat->input_text_view, "key-press-event",
                          G_CALLBACK (chat_input_key_press_event_cb),
                          chat);

and still no joy.

I wonder if this code in chat_input_key_press_event_cb() is getting
in the way:

	/* Catch enter but not ctrl/shift-enter */
	if (IS_ENTER (event->keyval) &&
	    !(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK))) {
		GtkTextView *view;
...

I'm not much of a gtk programmer so I don't know how gtkrc key-
bindings and the above code could/would interact.

Any ideas how I can proceed?

b.



More information about the telepathy mailing list