Fixed hitting enter key mid sentence
authorrodin <rodin@ddfedd41-794f-dd11-ae45-00112f111e67>
Tue, 30 Mar 2010 11:53:14 +0000 (11:53 +0000)
committerrodin <rodin@ddfedd41-794f-dd11-ae45-00112f111e67>
Tue, 30 Mar 2010 11:53:14 +0000 (11:53 +0000)
libchimara/input.c

index 96b6353f96f4b4fb9de6eff5dcb762020d4b64c7..df872da5496c6d582142b98b63c692e0e2864dce 100644 (file)
@@ -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 */