Changeset 60ebe63 in mainline for uspace/srv/hid/display/input.c


Ignore:
Timestamp:
2022-11-08T21:20:23Z (18 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7bcd15f
Parents:
3a6d44b7
Message:

Store positioning device ID in position events

File:
1 edited

Legend:

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

    r3a6d44b7 r60ebe63  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2022 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 *, kbd_event_type_t, keycode_t, keymod_t, char32_t);
    48 static errno_t ds_input_ev_move(input_t *, int, int);
    49 static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned);
    50 static errno_t ds_input_ev_button(input_t *, int, int);
    51 static errno_t ds_input_ev_dclick(input_t *, int);
     47static errno_t ds_input_ev_key(input_t *, unsigned, kbd_event_type_t, keycode_t,
     48    keymod_t, char32_t);
     49static errno_t ds_input_ev_move(input_t *, unsigned, int, int);
     50static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned,
     51    unsigned, unsigned);
     52static errno_t ds_input_ev_button(input_t *, unsigned, int, int);
     53static errno_t ds_input_ev_dclick(input_t *, unsigned, int);
    5254
    5355static input_ev_ops_t ds_input_ev_ops = {
     
    7173}
    7274
    73 static errno_t ds_input_ev_key(input_t *input, kbd_event_type_t type,
    74     keycode_t key, keymod_t mods, char32_t c)
     75static 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)
    7577{
    7678        ds_display_t *disp = (ds_display_t *) input->user;
    7779        kbd_event_t event;
    7880        errno_t rc;
     81
     82        (void)kbd_id;
    7983
    8084        event.type = type;
     
    8993}
    9094
    91 static 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 
     95static errno_t ds_input_ev_move(input_t *input, unsigned pos_id, int dx, int dy)
     96{
     97        ds_display_t *disp = (ds_display_t *) input->user;
     98        ptd_event_t event;
     99        errno_t rc;
     100
     101        event.pos_id = pos_id;
    97102        event.type = PTD_MOVE;
    98103        event.dmove.x = dx;
     
    105110}
    106111
    107 static 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 
     112static errno_t ds_input_ev_abs_move(input_t *input, unsigned pos_id, unsigned x,
     113    unsigned y, unsigned max_x, unsigned max_y)
     114{
     115        ds_display_t *disp = (ds_display_t *) input->user;
     116        ptd_event_t event;
     117        errno_t rc;
     118
     119        event.pos_id = pos_id;
    114120        event.type = PTD_ABS_MOVE;
    115121        event.apos.x = x;
     
    126132}
    127133
    128 static 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 
     134static errno_t ds_input_ev_button(input_t *input, unsigned pos_id, int bnum,
     135    int bpress)
     136{
     137        ds_display_t *disp = (ds_display_t *) input->user;
     138        ptd_event_t event;
     139        errno_t rc;
     140
     141        event.pos_id = pos_id;
    134142        event.type = bpress ? PTD_PRESS : PTD_RELEASE;
    135143        event.btn_num = bnum;
     
    143151}
    144152
    145 static 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 
     153static errno_t ds_input_ev_dclick(input_t *input, unsigned pos_id, int bnum)
     154{
     155        ds_display_t *disp = (ds_display_t *) input->user;
     156        ptd_event_t event;
     157        errno_t rc;
     158
     159        event.pos_id = pos_id;
    151160        event.type = PTD_DCLICK;
    152161        event.btn_num = bnum;
Note: See TracChangeset for help on using the changeset viewer.