Changeset 12dd36c in mainline for uspace/lib/ui/src/msgdialog.c
- Timestamp:
- 2024-11-12T10:04:38Z (2 months ago)
- Branches:
- master
- Children:
- 1eeddb3, 64c8132, 8279aab, 9bfb74a, ad85592, ed19604b
- Parents:
- 9a07ee3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/msgdialog.c
r9a07ee3 r12dd36c 47 47 48 48 static void ui_msg_dialog_wnd_close(ui_window_t *, void *); 49 static void ui_msg_dialog_wnd_kbd(ui_window_t *, void *, kbd_event_t *); 49 50 50 51 ui_window_cb_t ui_msg_dialog_wnd_cb = { 51 .close = ui_msg_dialog_wnd_close 52 .close = ui_msg_dialog_wnd_close, 53 .kbd = ui_msg_dialog_wnd_kbd 52 54 }; 53 55 … … 281 283 } 282 284 285 /** Message dialog window keyboard event handler. 286 * 287 * @param window Window 288 * @param arg Argument (ui_msg_dialog_t *) 289 * @param event Keyboard event 290 */ 291 static void ui_msg_dialog_wnd_kbd(ui_window_t *window, void *arg, 292 kbd_event_t *event) 293 { 294 ui_msg_dialog_t *dialog = (ui_msg_dialog_t *) arg; 295 ui_evclaim_t claim; 296 297 claim = ui_window_def_kbd(window, event); 298 if (claim == ui_claimed) 299 return; 300 301 if (event->type == KEY_PRESS && 302 (event->mods & (KM_CTRL | KM_SHIFT | KM_ALT)) == 0) { 303 if (event->key == KC_ENTER) { 304 /* OK / default button */ 305 if (dialog->cb != NULL && dialog->cb->button != NULL) { 306 dialog->cb->button(dialog, dialog->arg, 0); 307 return; 308 } 309 } else if (event->key == KC_ESCAPE) { 310 /* Cancel */ 311 if (dialog->cb != NULL && dialog->cb->close != NULL) { 312 dialog->cb->close(dialog, dialog->arg); 313 return; 314 } 315 } 316 } 317 318 } 319 283 320 /** Message dialog button click handler. 284 321 *
Note:
See TracChangeset
for help on using the changeset viewer.