Changeset c88d7f99 in mainline for uspace/lib/ui/src/menu.c


Ignore:
Timestamp:
2022-03-10T17:44:35Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c38ab6c
Parents:
96c6a00
Message:

Menu entry accelerators

File:
1 edited

Legend:

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

    r96c6a00 rc88d7f99  
    604604static void ui_menu_key_press_unmod(ui_menu_t *menu, kbd_event_t *event)
    605605{
     606        ui_menu_entry_t *mentry;
     607        char32_t c;
     608
    606609        switch (event->key) {
    607610        case KC_ESCAPE:
     
    625628                break;
    626629        default:
     630                if (event->c != '\0') {
     631                        mentry = ui_menu_entry_first(menu);
     632                        while (mentry != NULL) {
     633                                c = ui_menu_entry_get_accel(mentry);
     634                                if (c == event->c && menu->selected != NULL) {
     635                                        ui_menu_entry_activate(mentry);
     636                                        break;
     637                                }
     638                                mentry = ui_menu_entry_next(mentry);
     639                        }
     640                }
    627641                break;
    628642        }
Note: See TracChangeset for help on using the changeset viewer.