Changeset 338d0935 in mainline for uspace/srv/hid/display/window.c


Ignore:
Timestamp:
2020-03-02T11:22:01Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a2e104e
Parents:
7bb45e3
git-author:
Jiri Svoboda <jiri@…> (2020-02-01 11:18:50)
git-committer:
Jiri Svoboda <jiri@…> (2020-03-02 11:22:01)
Message:

Closing windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/window.c

    r7bb45e3 r338d0935  
    529529}
    530530
     531/** Post keyboard event to window.
     532 *
     533 * @param wnd Window
     534 * @param event Event
     535 *
     536 * @return EOK on success or an error code
     537 */
     538errno_t ds_window_post_kbd_event(ds_window_t *wnd, kbd_event_t *event)
     539{
     540        bool alt_or_shift;
     541
     542        alt_or_shift = event->mods & (KM_SHIFT | KM_ALT);
     543
     544        if (event->type == KEY_PRESS && alt_or_shift && event->key == KC_F4) {
     545                /* On Alt-F4 or Shift-F4 send close event to the window */
     546                ds_client_post_close_event(wnd->client, wnd);
     547                return EOK;
     548        }
     549
     550        return ds_client_post_kbd_event(wnd->client, wnd, event);
     551}
     552
    531553/** Post position event to window.
    532554 *
Note: See TracChangeset for help on using the changeset viewer.