Mercurial > vim
changeset 1355:888c0645d64f v7.1.069
updated for version 7.1-069
author | vimboss |
---|---|
date | Tue, 14 Aug 2007 13:00:40 +0000 |
parents | 10a1b67c0885 |
children | c87f38b71d27 |
files | src/gui_gtk.c src/version.c |
diffstat | 2 files changed, 15 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -1630,11 +1630,14 @@ dlg_button_clicked(GtkWidget * widget, B */ /*ARGSUSED*/ static int -dlg_key_press_event(GtkWidget * widget, GdkEventKey * event, CancelData *data) +dlg_key_press_event(GtkWidget *widget, GdkEventKey *event, CancelData *data) { - /* Ignore hitting Enter when there is no default button. */ - if (data->ignore_enter && event->keyval == GDK_Return) + /* Ignore hitting Enter (or Space) when there is no default button. */ + if (data->ignore_enter && (event->keyval == GDK_Return + || event->keyval == ' ')) return TRUE; + else /* A different key was pressed, return to normal behavior */ + data->ignore_enter = FALSE; if (event->keyval != GDK_Escape && event->keyval != GDK_Return) return FALSE; @@ -2224,6 +2227,13 @@ dialog_key_press_event_cb(GtkWidget *wid { DialogInfo *di = (DialogInfo *)data; + /* Ignore hitting Enter (or Space) when there is no default button. */ + if (di->ignore_enter && (event->keyval == GDK_Return + || event->keyval == ' ')) + return TRUE; + else /* A different key was pressed, return to normal behavior */ + di->ignore_enter = FALSE; + /* Close the dialog when hitting "Esc". */ if (event->keyval == GDK_Escape) {