Changeset 60ebe63 in mainline for uspace/lib/c/generic/io/input.c


Ignore:
Timestamp:
2022-11-08T21:20:23Z (3 years 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/lib/c/generic/io/input.c

    r3a6d44b7 r60ebe63  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2022 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    106106static void input_ev_key(input_t *input, ipc_call_t *call)
    107107{
     108        unsigned kbd_id;
    108109        kbd_event_type_t type;
    109110        keycode_t key;
     
    112113        errno_t rc;
    113114
    114         type = ipc_get_arg1(call);
    115         key = ipc_get_arg2(call);
    116         mods = ipc_get_arg3(call);
    117         c = ipc_get_arg4(call);
    118 
    119         rc = input->ev_ops->key(input, type, key, mods, c);
     115        kbd_id = ipc_get_arg1(call);
     116        type = ipc_get_arg2(call);
     117        key = ipc_get_arg3(call);
     118        mods = ipc_get_arg4(call);
     119        c = ipc_get_arg5(call);
     120
     121        rc = input->ev_ops->key(input, kbd_id, type, key, mods, c);
    120122        async_answer_0(call, rc);
    121123}
     
    123125static void input_ev_move(input_t *input, ipc_call_t *call)
    124126{
     127        unsigned pos_id;
    125128        int dx;
    126129        int dy;
    127130        errno_t rc;
    128131
    129         dx = ipc_get_arg1(call);
    130         dy = ipc_get_arg2(call);
    131 
    132         rc = input->ev_ops->move(input, dx, dy);
     132        pos_id = ipc_get_arg1(call);
     133        dx = ipc_get_arg2(call);
     134        dy = ipc_get_arg3(call);
     135
     136        rc = input->ev_ops->move(input, pos_id, dx, dy);
    133137        async_answer_0(call, rc);
    134138}
     
    136140static void input_ev_abs_move(input_t *input, ipc_call_t *call)
    137141{
     142        unsigned pos_id;
    138143        unsigned x;
    139144        unsigned y;
     
    142147        errno_t rc;
    143148
    144         x = ipc_get_arg1(call);
    145         y = ipc_get_arg2(call);
    146         max_x = ipc_get_arg3(call);
    147         max_y = ipc_get_arg4(call);
    148 
    149         rc = input->ev_ops->abs_move(input, x, y, max_x, max_y);
     149        pos_id = ipc_get_arg1(call);
     150        x = ipc_get_arg2(call);
     151        y = ipc_get_arg3(call);
     152        max_x = ipc_get_arg4(call);
     153        max_y = ipc_get_arg5(call);
     154
     155        rc = input->ev_ops->abs_move(input, pos_id, x, y, max_x, max_y);
    150156        async_answer_0(call, rc);
    151157}
     
    153159static void input_ev_button(input_t *input, ipc_call_t *call)
    154160{
     161        unsigned pos_id;
    155162        int bnum;
    156163        int press;
    157164        errno_t rc;
    158165
    159         bnum = ipc_get_arg1(call);
    160         press = ipc_get_arg2(call);
    161 
    162         rc = input->ev_ops->button(input, bnum, press);
     166        pos_id = ipc_get_arg1(call);
     167        bnum = ipc_get_arg2(call);
     168        press = ipc_get_arg3(call);
     169
     170        rc = input->ev_ops->button(input, pos_id, bnum, press);
    163171        async_answer_0(call, rc);
    164172}
     
    166174static void input_ev_dclick(input_t *input, ipc_call_t *call)
    167175{
     176        unsigned pos_id;
    168177        int bnum;
    169178        errno_t rc;
    170179
    171         bnum = ipc_get_arg1(call);
    172 
    173         rc = input->ev_ops->dclick(input, bnum);
     180        pos_id = ipc_get_arg1(call);
     181        bnum = ipc_get_arg2(call);
     182
     183        rc = input->ev_ops->dclick(input, pos_id, bnum);
    174184        async_answer_0(call, rc);
    175185}
Note: See TracChangeset for help on using the changeset viewer.