From: Marijn van Vliet Date: Tue, 30 Mar 2010 11:53:14 +0000 (+0000) Subject: Fixed hitting enter key mid sentence X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=830faf4676d26eb8094688e5ee995c2e2edce0e5;p=rodin%2Fchimara.git Fixed hitting enter key mid sentence git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@229 ddfedd41-794f-dd11-ae45-00112f111e67 --- diff --git a/libchimara/input.c b/libchimara/input.c index 96b6353..df872da 100644 --- a/libchimara/input.c +++ b/libchimara/input.c @@ -514,6 +514,15 @@ on_line_input_key_press_event(GtkWidget *widget, GdkEventKey *event, winid_t win return TRUE; } + /* Handle the enter key, which could occur in the middle of the sentence. */ + else if(event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) { + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(win->widget)); + GtkTextIter end_iter; + gtk_text_buffer_get_end_iter(buffer, &end_iter); + gtk_text_buffer_place_cursor(buffer, &end_iter); + return FALSE; + } + return FALSE; /* If this is a text grid window, then redirect the key press to the line input GtkEntry */