Changeset 9f7e9bb in mainline


Ignore:
Timestamp:
2021-10-25T00:32:45Z (3 years ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
be1d74c1
Parents:
0e80e40
git-author:
Jiri Svoboda <jiri@…> (2021-10-07 18:43:56)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2021-10-25 00:32:45)
Message:

Ctrl-Q to quit Navigator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nav/nav.c

    r0e80e40 r9f7e9bb  
    4848
    4949static void wnd_close(ui_window_t *, void *);
     50static void wnd_kbd(ui_window_t *, void *, kbd_event_t *);
    5051
    5152static ui_window_cb_t window_cb = {
    52         .close = wnd_close
     53        .close = wnd_close,
     54        .kbd = wnd_kbd
    5355};
    5456
     
    6365
    6466        ui_quit(navigator->ui);
     67}
     68
     69/** Window keyboard event handler.
     70 *
     71 * @param window Window
     72 * @param arg Argument (navigator)
     73 * @param event Keyboard event
     74 */
     75static void wnd_kbd(ui_window_t *window, void *arg, kbd_event_t *event)
     76{
     77        navigator_t *navigator = (navigator_t *) arg;
     78
     79        if (event->type == KEY_PRESS &&
     80            ((event->mods & KM_ALT) == 0) &&
     81            ((event->mods & KM_SHIFT) == 0) &&
     82            (event->mods & KM_CTRL) != 0) {
     83                if (event->key == KC_Q)
     84                        ui_quit(navigator->ui);
     85        }
     86
     87        ui_window_def_kbd(window, event);
    6588}
    6689
Note: See TracChangeset for help on using the changeset viewer.