Changeset 8edec53 in mainline for uspace/srv/hid/display/input.c


Ignore:
Timestamp:
2021-10-25T17:51:10Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
91ece11b
Parents:
805a149
Message:

Support double-click

Needed to open Navigator entries using the mouse.

File:
1 edited

Legend:

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

    r805a149 r8edec53  
    11/*
    2  * Copyright (c) 2019 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4949static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned);
    5050static errno_t ds_input_ev_button(input_t *, int, int);
     51static errno_t ds_input_ev_dclick(input_t *, int);
    5152
    5253static input_ev_ops_t ds_input_ev_ops = {
     
    5657        .move = ds_input_ev_move,
    5758        .abs_move = ds_input_ev_abs_move,
    58         .button = ds_input_ev_button
     59        .button = ds_input_ev_button,
     60        .dclick = ds_input_ev_dclick
    5961};
    6062
     
    131133
    132134        event.type = bpress ? PTD_PRESS : PTD_RELEASE;
     135        event.btn_num = bnum;
     136        event.dmove.x = 0;
     137        event.dmove.y = 0;
     138
     139        ds_display_lock(disp);
     140        rc = ds_display_post_ptd_event(disp, &event);
     141        ds_display_unlock(disp);
     142        return rc;
     143}
     144
     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
     151        event.type = PTD_DCLICK;
    133152        event.btn_num = bnum;
    134153        event.dmove.x = 0;
Note: See TracChangeset for help on using the changeset viewer.