Changeset 07b7c48 in mainline for uspace/lib
- Timestamp:
- 2013-04-12T09:01:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 902f0906
- Parents:
- bc4bf97
- Location:
- uspace/lib
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/console.c
rbc4bf97 r07b7c48 154 154 } 155 155 156 bool console_get_ kbd_event(console_ctrl_t *ctrl, kbd_event_t *event)156 bool console_get_event(console_ctrl_t *ctrl, cons_event_t *event) 157 157 { 158 158 if (ctrl->input_aid == 0) { … … 171 171 } 172 172 173 event->type = type; 174 event->key = key; 175 event->mods = mods; 176 event->c = c; 173 event->type = CEV_KEY; 174 event->ev.key.type = type; 175 event->ev.key.key = key; 176 event->ev.key.mods = mods; 177 event->ev.key.c = c; 177 178 } else { 178 179 sysarg_t retval; … … 186 187 } 187 188 188 event->type = IPC_GET_ARG1(ctrl->input_call); 189 event->key = IPC_GET_ARG2(ctrl->input_call); 190 event->mods = IPC_GET_ARG3(ctrl->input_call); 191 event->c = IPC_GET_ARG4(ctrl->input_call); 189 event->type = CEV_KEY; 190 event->ev.key.type = IPC_GET_ARG1(ctrl->input_call); 191 event->ev.key.key = IPC_GET_ARG2(ctrl->input_call); 192 event->ev.key.mods = IPC_GET_ARG3(ctrl->input_call); 193 event->ev.key.c = IPC_GET_ARG4(ctrl->input_call); 192 194 } 193 195 … … 195 197 } 196 198 197 bool console_get_ kbd_event_timeout(console_ctrl_t *ctrl, kbd_event_t *event,199 bool console_get_event_timeout(console_ctrl_t *ctrl, cons_event_t *event, 198 200 suseconds_t *timeout) 199 201 { … … 223 225 } 224 226 225 event->type = IPC_GET_ARG1(ctrl->input_call); 226 event->key = IPC_GET_ARG2(ctrl->input_call); 227 event->mods = IPC_GET_ARG3(ctrl->input_call); 228 event->c = IPC_GET_ARG4(ctrl->input_call); 227 event->type = CEV_KEY; 228 event->ev.key.type = IPC_GET_ARG1(ctrl->input_call); 229 event->ev.key.key = IPC_GET_ARG2(ctrl->input_call); 230 event->ev.key.mods = IPC_GET_ARG3(ctrl->input_call); 231 event->ev.key.c = IPC_GET_ARG4(ctrl->input_call); 229 232 230 233 /* Update timeout */ -
uspace/lib/c/include/io/console.h
rbc4bf97 r07b7c48 39 39 #include <io/concaps.h> 40 40 #include <io/kbd_event.h> 41 #include <io/cons_event.h> 41 42 #include <io/keycode.h> 42 43 #include <async.h> … … 82 83 extern void console_cursor_visibility(console_ctrl_t *, bool); 83 84 extern int console_get_color_cap(console_ctrl_t *, sysarg_t *); 84 extern bool console_get_ kbd_event(console_ctrl_t *, kbd_event_t *);85 extern bool console_get_ kbd_event_timeout(console_ctrl_t *, kbd_event_t *,85 extern bool console_get_event(console_ctrl_t *, cons_event_t *); 86 extern bool console_get_event_timeout(console_ctrl_t *, cons_event_t *, 86 87 suseconds_t *); 87 88 -
uspace/lib/clui/tinput.c
rbc4bf97 r07b7c48 816 816 console_flush(ti->console); 817 817 818 kbd_event_t ev;819 if (!console_get_ kbd_event(ti->console, &ev))818 cons_event_t ev; 819 if (!console_get_event(ti->console, &ev)) 820 820 return EIO; 821 821 822 if (ev.type != KEY_PRESS)822 if (ev.type != CEV_KEY || ev.ev.key.type != KEY_PRESS) 823 823 continue; 824 824 825 if (((ev.mods & KM_CTRL) != 0) && 826 ((ev.mods & (KM_ALT | KM_SHIFT)) == 0)) 827 tinput_key_ctrl(ti, &ev); 828 829 if (((ev.mods & KM_SHIFT) != 0) && 830 ((ev.mods & (KM_CTRL | KM_ALT)) == 0)) 831 tinput_key_shift(ti, &ev); 832 833 if (((ev.mods & KM_CTRL) != 0) && 834 ((ev.mods & KM_SHIFT) != 0) && 835 ((ev.mods & KM_ALT) == 0)) 836 tinput_key_ctrl_shift(ti, &ev); 837 838 if ((ev.mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) 839 tinput_key_unmod(ti, &ev); 840 841 if (ev.c >= ' ') { 825 kbd_event_t *kev = &ev.ev.key; 826 827 if (((kev->mods & KM_CTRL) != 0) && 828 ((kev->mods & (KM_ALT | KM_SHIFT)) == 0)) 829 tinput_key_ctrl(ti, kev); 830 831 if (((kev->mods & KM_SHIFT) != 0) && 832 ((kev->mods & (KM_CTRL | KM_ALT)) == 0)) 833 tinput_key_shift(ti, kev); 834 835 if (((kev->mods & KM_CTRL) != 0) && 836 ((kev->mods & KM_SHIFT) != 0) && 837 ((kev->mods & KM_ALT) == 0)) 838 tinput_key_ctrl_shift(ti, kev); 839 840 if ((kev->mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) 841 tinput_key_unmod(ti, kev); 842 843 if (kev->c >= ' ') { 842 844 tinput_sel_delete(ti); 843 tinput_insert_char(ti, ev.c);845 tinput_insert_char(ti, kev->c); 844 846 } 845 847 }
Note:
See TracChangeset
for help on using the changeset viewer.