Changeset 5de852c in mainline for uspace/lib/ui/src/window.c


Ignore:
Timestamp:
2022-01-11T13:12:15Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bfc0fc6
Parents:
59768c7
git-author:
Jiri Svoboda <jiri@…> (2022-01-10 20:11:54)
git-committer:
Jiri Svoboda <jiri@…> (2022-01-11 13:12:15)
Message:

Coordinate keyboard event delivery between application and UI framework

If an application sets its own keyboard event handler, it needs to call
ui_window_def_kbd() to deliver events to the window's UI control tree.
Menubar should be able to capture these events so that they are not
accidentally acted upon by the application keyboard handler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/window.c

    r59768c7 r5de852c  
    963963                window->cb->kbd(window, window->arg, kbd);
    964964        else
    965                 return ui_window_def_kbd(window, kbd);
     965                ui_window_def_kbd(window, kbd);
    966966}
    967967
     
    10051005 *
    10061006 * @param window Window
    1007  */
    1008 void ui_window_def_kbd(ui_window_t *window, kbd_event_t *kbd)
     1007 * @return ui_claimed iff event was claimed
     1008 */
     1009ui_evclaim_t ui_window_def_kbd(ui_window_t *window, kbd_event_t *kbd)
    10091010{
    10101011        if (window->control != NULL)
    1011                 ui_control_kbd_event(window->control, kbd);
     1012                return ui_control_kbd_event(window->control, kbd);
     1013
     1014        return ui_unclaimed;
    10121015}
    10131016
Note: See TracChangeset for help on using the changeset viewer.