Ignore:
File:
1 edited

Legend:

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

    r06f10ac r4c6fd56  
    11/*
     2 * Copyright (c) 2023 Jiri Svoboda
    23 * Copyright (c) 2006 Josef Cejka
    3  * Copyright (c) 2011 Jiri Svoboda
    44 * All rights reserved.
    55 *
     
    253253                if (client->active) {
    254254                        async_exch_t *exch = async_exchange_begin(client->sess);
    255                         async_msg_4(exch, INPUT_EVENT_KEY, ev.type, ev.key, ev.mods, ev.c);
     255                        async_msg_5(exch, INPUT_EVENT_KEY, kdev->svc_id,
     256                            ev.type, ev.key, ev.mods, ev.c);
    256257                        async_exchange_end(exch);
    257258                }
     
    267268
    268269                        if ((dx) || (dy))
    269                                 async_msg_2(exch, INPUT_EVENT_MOVE, dx, dy);
     270                                async_msg_3(exch, INPUT_EVENT_MOVE,
     271                                    mdev->svc_id, dx, dy);
    270272
    271273                        if (dz) {
     
    274276
    275277                                for (unsigned int i = 0; i < 3; i++)
    276                                         async_msg_4(exch, INPUT_EVENT_KEY, KEY_PRESS, code, 0, 0);
    277 
    278                                 async_msg_4(exch, INPUT_EVENT_KEY, KEY_RELEASE, code, 0, 0);
     278                                        async_msg_5(exch, INPUT_EVENT_KEY,
     279                                            0 /* XXX kbd_id */,
     280                                            KEY_PRESS, code, 0, 0);
     281
     282                                async_msg_5(exch, INPUT_EVENT_KEY, KEY_RELEASE,
     283                                    0 /* XXX kbd_id */, code, 0, 0);
    279284                        }
    280285
     
    292297                        if ((max_x) && (max_y)) {
    293298                                async_exch_t *exch = async_exchange_begin(client->sess);
    294                                 async_msg_4(exch, INPUT_EVENT_ABS_MOVE, x, y, max_x, max_y);
     299                                async_msg_5(exch, INPUT_EVENT_ABS_MOVE,
     300                                    mdev->svc_id, x, y, max_x, max_y);
    295301                                async_exchange_end(exch);
    296302                        }
     
    305311                if (client->active) {
    306312                        async_exch_t *exch = async_exchange_begin(client->sess);
    307                         async_msg_2(exch, INPUT_EVENT_BUTTON, bnum, press);
     313                        async_msg_3(exch, INPUT_EVENT_BUTTON, mdev->svc_id,
     314                            bnum, press);
    308315                        async_exchange_end(exch);
    309316                }
     
    311318}
    312319
    313 /** Arbitrate client actiovation */
     320/** Mouse button has been double-clicked. */
     321void mouse_push_event_dclick(mouse_dev_t *mdev, int bnum)
     322{
     323        list_foreach(clients, link, client_t, client) {
     324                if (client->active) {
     325                        async_exch_t *exch = async_exchange_begin(client->sess);
     326                        async_msg_2(exch, INPUT_EVENT_DCLICK, mdev->svc_id,
     327                            bnum);
     328                        async_exchange_end(exch);
     329                }
     330        }
     331}
     332
     333/** Arbitrate client activation */
    314334static void client_arbitration(void)
    315335{
     
    858878{
    859879        errno_t rc;
     880        loc_srv_t *srv;
    860881
    861882        if (argc < 2) {
     
    881902        async_set_fallback_port_handler(client_connection, NULL);
    882903
    883         rc = loc_server_register(NAME);
     904        rc = loc_server_register(NAME, &srv);
    884905        if (rc != EOK) {
    885906                printf("%s: Unable to register server\n", NAME);
     
    888909
    889910        service_id_t service_id;
    890         rc = loc_service_register(argv[1], &service_id);
     911        rc = loc_service_register(srv, argv[1], &service_id);
    891912        if (rc != EOK) {
    892913                printf("%s: Unable to register service %s\n", NAME, argv[1]);
Note: See TracChangeset for help on using the changeset viewer.