Changes in uspace/srv/hid/input/generic/input.c [10a5479d:5da7199] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/generic/input.c
r10a5479d r5da7199 39 39 #include <adt/list.h> 40 40 #include <bool.h> 41 #include <fibril_synch.h>42 41 #include <ipc/services.h> 43 42 #include <ipc/input.h> … … 84 83 async_sess_t *irc_sess = NULL; 85 84 86 static FIBRIL_MUTEX_INITIALIZE(discovery_lock);87 88 85 void kbd_push_data(kbd_dev_t *kdev, sysarg_t data) 89 86 { … … 175 172 176 173 /** Mouse pointer has moved. */ 177 void mouse_push_event_move(mouse_dev_t *mdev, int dx, int dy , int dz)174 void mouse_push_event_move(mouse_dev_t *mdev, int dx, int dy) 178 175 { 179 176 async_exch_t *exch = async_exchange_begin(client_sess); 180 if (dx || dy) 181 async_msg_2(exch, INPUT_EVENT_MOVE, dx, dy); 182 if (dz) { 183 // TODO: Implement proper wheel support 184 keycode_t code = dz > 0 ? KC_UP : KC_DOWN; 185 for (int i = 0; i < 3; ++i) { 186 async_msg_4(exch, INPUT_EVENT_KEY, KEY_PRESS, code, 0, 0); 187 } 188 async_msg_4(exch, INPUT_EVENT_KEY, KEY_RELEASE, code, 0, 0); 189 } 177 async_msg_2(exch, INPUT_EVENT_MOVE, dx, dy); 190 178 async_exchange_end(exch); 191 179 } … … 409 397 * them automatically. 410 398 */ 399 #if defined(UARCH_amd64) 400 kbd_add_dev(&chardev_port, &pc_ctl); 401 #endif 411 402 #if defined(UARCH_arm32) && defined(MACHINE_gta02) 412 403 kbd_add_dev(&chardev_port, &stty_ctl); … … 420 411 #if defined(UARCH_arm32) && defined(MACHINE_integratorcp) 421 412 kbd_add_dev(&pl050_port, &pc_ctl); 413 #endif 414 #if defined(UARCH_ia32) 415 kbd_add_dev(&chardev_port, &pc_ctl); 416 #endif 417 #if defined(MACHINE_i460GX) 418 kbd_add_dev(&chardev_port, &pc_ctl); 422 419 #endif 423 420 #if defined(MACHINE_ski) … … 453 450 * them automatically. 454 451 */ 452 #if defined(UARCH_amd64) 453 mouse_add_dev(&chardev_mouse_port, &ps2_proto); 454 #endif 455 #if defined(UARCH_ia32) 456 mouse_add_dev(&chardev_mouse_port, &ps2_proto); 457 #endif 458 #if defined(MACHINE_i460GX) 459 mouse_add_dev(&chardev_mouse_port, &ps2_proto); 460 #endif 455 461 #if defined(UARCH_ppc32) 456 462 mouse_add_dev(&adb_mouse_port, &adb_proto); … … 596 602 int rc; 597 603 598 fibril_mutex_lock(&discovery_lock);599 600 604 rc = dev_check_new_kbdevs(); 601 if (rc != EOK) { 602 fibril_mutex_unlock(&discovery_lock); 605 if (rc != EOK) 603 606 return rc; 604 }605 607 606 608 rc = dev_check_new_mousedevs(); 607 if (rc != EOK) { 608 fibril_mutex_unlock(&discovery_lock); 609 if (rc != EOK) 609 610 return rc; 610 } 611 612 fibril_mutex_unlock(&discovery_lock); 613 611 614 612 return EOK; 615 613 } … … 660 658 661 659 /* Register driver */ 662 async_set_client_connection(client_connection); 663 int rc = loc_server_register(NAME); 660 int rc = loc_server_register(NAME, client_connection); 664 661 if (rc < 0) { 665 662 printf("%s: Unable to register server (%d)\n", NAME, rc);
Note:
See TracChangeset
for help on using the changeset viewer.