Ignore:
File:
1 edited

Legend:

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

    r88d828e r8edec53  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4545static errno_t ds_input_ev_active(input_t *);
    4646static errno_t ds_input_ev_deactive(input_t *);
    47 static errno_t ds_input_ev_key(input_t *, unsigned, kbd_event_type_t, keycode_t,
    48     keymod_t, char32_t);
    49 static errno_t ds_input_ev_move(input_t *, unsigned, int, int);
    50 static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned,
    51     unsigned, unsigned);
    52 static errno_t ds_input_ev_button(input_t *, unsigned, int, int);
    53 static errno_t ds_input_ev_dclick(input_t *, unsigned, int);
     47static errno_t ds_input_ev_key(input_t *, kbd_event_type_t, keycode_t, keymod_t, char32_t);
     48static errno_t ds_input_ev_move(input_t *, int, int);
     49static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned);
     50static errno_t ds_input_ev_button(input_t *, int, int);
     51static errno_t ds_input_ev_dclick(input_t *, int);
    5452
    5553static input_ev_ops_t ds_input_ev_ops = {
     
    7371}
    7472
    75 static errno_t ds_input_ev_key(input_t *input, unsigned kbd_id,
    76     kbd_event_type_t type, keycode_t key, keymod_t mods, char32_t c)
     73static errno_t ds_input_ev_key(input_t *input, kbd_event_type_t type,
     74    keycode_t key, keymod_t mods, char32_t c)
    7775{
    7876        ds_display_t *disp = (ds_display_t *) input->user;
     
    8078        errno_t rc;
    8179
    82         event.kbd_id = kbd_id;
    8380        event.type = type;
    8481        event.key = key;
     
    9289}
    9390
    94 static errno_t ds_input_ev_move(input_t *input, unsigned pos_id, int dx, int dy)
    95 {
    96         ds_display_t *disp = (ds_display_t *) input->user;
    97         ptd_event_t event;
    98         errno_t rc;
    99 
    100         event.pos_id = pos_id;
     91static errno_t ds_input_ev_move(input_t *input, int dx, int dy)
     92{
     93        ds_display_t *disp = (ds_display_t *) input->user;
     94        ptd_event_t event;
     95        errno_t rc;
     96
    10197        event.type = PTD_MOVE;
    10298        event.dmove.x = dx;
     
    109105}
    110106
    111 static errno_t ds_input_ev_abs_move(input_t *input, unsigned pos_id, unsigned x,
    112     unsigned y, unsigned max_x, unsigned max_y)
    113 {
    114         ds_display_t *disp = (ds_display_t *) input->user;
    115         ptd_event_t event;
    116         errno_t rc;
    117 
    118         event.pos_id = pos_id;
     107static errno_t ds_input_ev_abs_move(input_t *input, unsigned x, unsigned y,
     108    unsigned max_x, unsigned max_y)
     109{
     110        ds_display_t *disp = (ds_display_t *) input->user;
     111        ptd_event_t event;
     112        errno_t rc;
     113
    119114        event.type = PTD_ABS_MOVE;
    120115        event.apos.x = x;
     
    131126}
    132127
    133 static errno_t ds_input_ev_button(input_t *input, unsigned pos_id, int bnum,
    134     int bpress)
    135 {
    136         ds_display_t *disp = (ds_display_t *) input->user;
    137         ptd_event_t event;
    138         errno_t rc;
    139 
    140         event.pos_id = pos_id;
     128static errno_t ds_input_ev_button(input_t *input, int bnum, int bpress)
     129{
     130        ds_display_t *disp = (ds_display_t *) input->user;
     131        ptd_event_t event;
     132        errno_t rc;
     133
    141134        event.type = bpress ? PTD_PRESS : PTD_RELEASE;
    142135        event.btn_num = bnum;
     
    150143}
    151144
    152 static errno_t ds_input_ev_dclick(input_t *input, unsigned pos_id, int bnum)
    153 {
    154         ds_display_t *disp = (ds_display_t *) input->user;
    155         ptd_event_t event;
    156         errno_t rc;
    157 
    158         event.pos_id = pos_id;
     145static errno_t ds_input_ev_dclick(input_t *input, int bnum)
     146{
     147        ds_display_t *disp = (ds_display_t *) input->user;
     148        ptd_event_t event;
     149        errno_t rc;
     150
    159151        event.type = PTD_DCLICK;
    160152        event.btn_num = bnum;
Note: See TracChangeset for help on using the changeset viewer.