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


Ignore:
Timestamp:
2021-10-25T17:51:10Z (3 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/console/console.c

    r805a149 r8edec53  
    124124static errno_t input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned);
    125125static errno_t input_ev_button(input_t *, int, int);
     126static errno_t input_ev_dclick(input_t *, int);
    126127
    127128static input_ev_ops_t input_ev_ops = {
     
    131132        .move = input_ev_move,
    132133        .abs_move = input_ev_abs_move,
    133         .button = input_ev_button
     134        .button = input_ev_button,
     135        .dclick = input_ev_dclick
    134136};
    135137
     
    440442}
    441443
     444static errno_t input_ev_dclick(input_t *input, int bnum)
     445{
     446        cons_event_t event;
     447
     448        event.type = CEV_POS;
     449        event.ev.pos.type = POS_DCLICK;
     450        event.ev.pos.btn_num = bnum;
     451        event.ev.pos.hpos = pointer_x / mouse_scale_x;
     452        event.ev.pos.vpos = pointer_y / mouse_scale_y;
     453
     454        console_queue_cons_event(active_console, &event);
     455        return EOK;
     456}
     457
    442458/** Process a character from the client (TTY emulation). */
    443459static void cons_write_char(console_t *cons, char32_t ch)
Note: See TracChangeset for help on using the changeset viewer.