Changeset 07b7c48 in mainline for uspace/lib/c/generic/io/console.c


Ignore:
Timestamp:
2013-04-12T09:01:10Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
902f0906
Parents:
bc4bf97
Message:

Extend console library API to support different event types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/console.c

    rbc4bf97 r07b7c48  
    154154}
    155155
    156 bool console_get_kbd_event(console_ctrl_t *ctrl, kbd_event_t *event)
     156bool console_get_event(console_ctrl_t *ctrl, cons_event_t *event)
    157157{
    158158        if (ctrl->input_aid == 0) {
     
    171171                }
    172172               
    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;
    177178        } else {
    178179                sysarg_t retval;
     
    186187                }
    187188               
    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);
    192194        }
    193195       
     
    195197}
    196198
    197 bool console_get_kbd_event_timeout(console_ctrl_t *ctrl, kbd_event_t *event,
     199bool console_get_event_timeout(console_ctrl_t *ctrl, cons_event_t *event,
    198200    suseconds_t *timeout)
    199201{
     
    223225        }
    224226       
    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);
    229232       
    230233        /* Update timeout */
Note: See TracChangeset for help on using the changeset viewer.