Changeset 2f11647f in mainline
- Timestamp:
- 2024-03-18T14:43:51Z (8 months ago)
- Branches:
- master
- Children:
- a29af37
- Parents:
- 7b7a7d2
- Location:
- uspace/app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/barber/barber.c
r7b7a7d2 r2f11647f 102 102 103 103 static void wnd_close(ui_window_t *, void *); 104 static void wnd_kbd_event(ui_window_t *, void *, kbd_event_t *); 104 105 105 106 static ui_window_cb_t window_cb = { 106 .close = wnd_close 107 .close = wnd_close, 108 .kbd = wnd_kbd_event 107 109 }; 110 108 111 109 112 /** Window close button was clicked. … … 117 120 118 121 ui_quit(barber->ui); 122 } 123 124 /** Barber unmodified key press. 125 * 126 * @param barber Barber 127 * @param event Keyboard event 128 */ 129 static void barber_kbd_event_unmod(barber_t *barber, kbd_event_t *event) 130 { 131 if (event->key == KC_ESCAPE) 132 ui_quit(barber->ui); 133 } 134 135 /** Barber ctrl-key key press. 136 * 137 * @param barber Barber 138 * @param event Keyboard event 139 */ 140 static void barber_kbd_event_ctrl(barber_t *barber, kbd_event_t *event) 141 { 142 if (event->key == KC_Q) 143 ui_quit(barber->ui); 144 } 145 146 /** Barber window keyboard event. 147 * 148 * @param window UI window 149 * @param arg Argument (barber_t *) 150 * @param event Keyboard event 151 */ 152 static void wnd_kbd_event(ui_window_t *window, void *arg, kbd_event_t *event) 153 { 154 barber_t *barber = (barber_t *)arg; 155 156 if (event->type != KEY_PRESS) 157 return; 158 159 if ((event->mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) 160 barber_kbd_event_unmod(barber, event); 161 162 if ((event->mods & KM_CTRL) != 0 && 163 (event->mods & (KM_ALT | KM_SHIFT)) == 0) 164 barber_kbd_event_ctrl(barber, event); 165 166 ui_window_def_kbd(window, event); 119 167 } 120 168 -
uspace/app/viewer/viewer.c
r7b7a7d2 r2f11647f 181 181 (event->mods & (KM_ALT | KM_SHIFT)) == 0) 182 182 viewer_kbd_event_ctrl(viewer, event); 183 184 ui_window_def_kbd(window, event); 183 185 } 184 186
Note:
See TracChangeset
for help on using the changeset viewer.