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