Changes in uspace/drv/usbhid/kbd/kbddev.c [252cf2a:bd2394b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbd/kbddev.c
r252cf2a rbd2394b 255 255 256 256 if (hid_dev == NULL || hid_dev->data == NULL) { 257 usb_log_debug("default_connection_handler: "258 "Missing parameter.\n");259 257 async_answer_0(icallid, EINVAL); 260 258 return; … … 269 267 270 268 if (kbd_dev->console_phone != -1) { 271 usb_log_debug("default_connection_handler: "272 "console phone already set\n");273 269 async_answer_0(icallid, ELIMIT); 274 270 return; … … 276 272 277 273 kbd_dev->console_phone = callback; 278 279 usb_log_debug("default_connection_handler: OK\n");280 274 async_answer_0(icallid, EOK); 281 275 return; 282 276 } 283 277 284 usb_log_debug("default_connection_handler: Wrong function.\n");285 278 async_answer_0(icallid, EINVAL); 286 279 } … … 562 555 usb_log_debug2("Key pressed: %d (keycode: %d)\n", key, 563 556 kbd_dev->keys[i]); 557 usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key); 564 558 if (!usb_kbd_is_lock(key)) { 565 559 usb_kbd_repeat_start(kbd_dev, key); 566 560 } 567 usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key);568 561 } else { 569 562 // found, nothing happens … … 677 670 // callbacks, kbd_dev); 678 671 usb_hid_report_path_t *path = usb_hid_report_path(); 679 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_ GENERIC_DESKTOP, 6);672 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 680 673 //usb_hid_report_path_set_report_id(path, 0); 681 674 … … 695 688 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 696 689 hid_dev->report, NULL, path, 697 USB_HID_PATH_COMPARE_ BEGIN,690 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 698 691 USB_HID_REPORT_TYPE_INPUT); 699 692 unsigned i = 0; 700 693 701 694 while (field != NULL) { 702 695 //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n", … … 716 709 * two parts of the Report somehow. 717 710 */ 718 usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage);719 711 if (field->value != 0) { 720 //kbd_dev->keys[i] = field->usage;712 kbd_dev->keys[i] = field->usage; 721 713 } 722 714 else { 723 //kbd_dev->keys[i] = 0;715 kbd_dev->keys[i] = 0; 724 716 } 725 //usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);717 usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]); 726 718 727 719 ++i; 728 720 field = usb_hid_report_get_sibling(hid_dev->report, field, path, 729 USB_HID_PATH_COMPARE_BEGIN, 721 USB_HID_PATH_COMPARE_END 722 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 730 723 USB_HID_REPORT_TYPE_INPUT); 731 usb_log_debug("field -- %p\n", field);732 724 } 733 725 … … 861 853 * TODO: make more general 862 854 */ 855 usb_hid_report_path_t *path = usb_hid_report_path(); 856 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 857 858 usb_hid_report_path_set_report_id(path, 0); 859 863 860 kbd_dev->key_count = usb_hid_report_size( 864 861 hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT); 865 866 usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count); 862 usb_hid_report_path_free(path); 863 864 usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count); 865 867 866 kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t)); 868 867 … … 980 979 return rc; 981 980 } 982 981 983 982 return EOK; 984 983 }
Note:
See TracChangeset
for help on using the changeset viewer.