Skip to content

Commit

Permalink
Fix #1558: Keypad Enter Not working in file Rename dialog
Browse files Browse the repository at this point in the history
#1558

Also ensure GDK_KEY_KP_Enter is an alternative to GDK_KEY_Return
throughout the project.
  • Loading branch information
caclark committed Dec 15, 2024
1 parent 3c56255 commit ba0e043
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static void height_spin_changed_cb(GtkSpinButton *spin, gpointer data)

static void height_spin_key_press_cb(GtkEventControllerKey *, gint keyval, guint, GdkModifierType, gpointer data)
{
if ((keyval == GDK_KEY_Return || keyval == GDK_KEY_Escape))
if ((keyval == GDK_KEY_Return || keyval == GDK_KEY_KP_Enter || keyval == GDK_KEY_Escape))
{
gq_gtk_widget_destroy(GTK_WIDGET(data));
}
Expand Down
1 change: 1 addition & 0 deletions src/search-and-run.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ static gboolean keypress_cb(GtkWidget *, GdkEventKey *event, gpointer data)
ret = TRUE;
break;
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
break;
default:
sar->match_found = FALSE;
Expand Down
2 changes: 1 addition & 1 deletion src/ui-utildlg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static gboolean generic_dialog_default_key_press_cb(GtkWidget *widget, GdkEventK
{
auto gd = static_cast<GenericDialog *>(data);

if (event->keyval == GDK_KEY_Return && gtk_widget_has_focus(widget)
if ((event->keyval == (GDK_KEY_Return) || (event->keyval == GDK_KEY_KP_Enter)) && gtk_widget_has_focus(widget)
&& gd->default_cb)
{
gboolean auto_close;
Expand Down

0 comments on commit ba0e043

Please sign in to comment.