Index: uspace/lib/ui/src/filedialog.c
===================================================================
--- uspace/lib/ui/src/filedialog.c	(revision 9a07ee3efa9f0bc51fee1cb5d2a8dd94cb95c6a0)
+++ uspace/lib/ui/src/filedialog.c	(revision 91042127f2ad6c1d235bbb43f9bc5d97affb41c5)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2022 Jiri Svoboda
+ * Copyright (c) 2024 Jiri Svoboda
  * All rights reserved.
  *
@@ -396,5 +396,5 @@
  *
  * @param window Window
- * @param arg Argument (ui_prompt_dialog_t *)
+ * @param arg Argument (ui_file_dialog_t *)
  * @param event Keyboard event
  */
@@ -427,5 +427,4 @@
 		}
 	}
-
 }
 
Index: uspace/lib/ui/src/msgdialog.c
===================================================================
--- uspace/lib/ui/src/msgdialog.c	(revision 9a07ee3efa9f0bc51fee1cb5d2a8dd94cb95c6a0)
+++ uspace/lib/ui/src/msgdialog.c	(revision 91042127f2ad6c1d235bbb43f9bc5d97affb41c5)
@@ -47,7 +47,9 @@
 
 static void ui_msg_dialog_wnd_close(ui_window_t *, void *);
+static void ui_msg_dialog_wnd_kbd(ui_window_t *, void *, kbd_event_t *);
 
 ui_window_cb_t ui_msg_dialog_wnd_cb = {
-	.close = ui_msg_dialog_wnd_close
+	.close = ui_msg_dialog_wnd_close,
+	.kbd = ui_msg_dialog_wnd_kbd
 };
 
@@ -281,4 +283,39 @@
 }
 
+/** Message dialog window keyboard event handler.
+ *
+ * @param window Window
+ * @param arg Argument (ui_msg_dialog_t *)
+ * @param event Keyboard event
+ */
+static void ui_msg_dialog_wnd_kbd(ui_window_t *window, void *arg,
+    kbd_event_t *event)
+{
+	ui_msg_dialog_t *dialog = (ui_msg_dialog_t *) arg;
+	ui_evclaim_t claim;
+
+	claim = ui_window_def_kbd(window, event);
+	if (claim == ui_claimed)
+		return;
+
+	if (event->type == KEY_PRESS &&
+	    (event->mods & (KM_CTRL | KM_SHIFT | KM_ALT)) == 0) {
+		if (event->key == KC_ENTER) {
+			/* OK / default button */
+			if (dialog->cb != NULL && dialog->cb->button != NULL) {
+				dialog->cb->button(dialog, dialog->arg, 0);
+				return;
+			}
+		} else if (event->key == KC_ESCAPE) {
+			/* Cancel */
+			if (dialog->cb != NULL && dialog->cb->close != NULL) {
+				dialog->cb->close(dialog, dialog->arg);
+				return;
+			}
+		}
+	}
+
+}
+
 /** Message dialog button click handler.
  *
