Changes in / [1989cdf:f55ded3] in mainline
- Location:
- uspace/drv/usbhid
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbd/kbddev.c
r1989cdf rf55ded3 677 677 // callbacks, kbd_dev); 678 678 usb_hid_report_path_t *path = usb_hid_report_path(); 679 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); 680 680 //usb_hid_report_path_set_report_id(path, 0); 681 681 … … 695 695 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 696 696 hid_dev->report, NULL, path, 697 USB_HID_PATH_COMPARE_ END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,697 USB_HID_PATH_COMPARE_BEGIN, 698 698 USB_HID_REPORT_TYPE_INPUT); 699 699 unsigned i = 0; 700 700 701 701 while (field != NULL) { 702 702 //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n", … … 716 716 * two parts of the Report somehow. 717 717 */ 718 usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage); 718 719 if (field->value != 0) { 719 kbd_dev->keys[i] = field->usage;720 //kbd_dev->keys[i] = field->usage; 720 721 } 721 722 else { 722 kbd_dev->keys[i] = 0;723 //kbd_dev->keys[i] = 0; 723 724 } 724 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]); 725 726 726 727 ++i; 727 728 field = usb_hid_report_get_sibling(hid_dev->report, field, path, 728 USB_HID_PATH_COMPARE_END 729 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 729 USB_HID_PATH_COMPARE_BEGIN, 730 730 USB_HID_REPORT_TYPE_INPUT); 731 usb_log_debug("field -- %p\n", field); 731 732 } 732 733 … … 860 861 * TODO: make more general 861 862 */ 862 usb_hid_report_path_t *path = usb_hid_report_path();863 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);864 865 usb_hid_report_path_set_report_id(path, 0);866 867 863 kbd_dev->key_count = usb_hid_report_size( 868 864 hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT); 869 usb_hid_report_path_free(path); 870 871 usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count); 872 865 866 usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count); 873 867 kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t)); 874 868 … … 986 980 return rc; 987 981 } 988 982 989 983 return EOK; 990 984 } -
uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c
r1989cdf rf55ded3 180 180 * @param key Key code of the key according to HID Usage Tables. 181 181 */ 182 /* 182 183 static void usb_lgtch_push_ev(usb_hid_dev_t *hid_dev, int type, 183 184 unsigned int key) … … 206 207 ev.mods, ev.c); 207 208 } 208 209 */ 209 210 /*----------------------------------------------------------------------------*/ 210 211 … … 396 397 397 398 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 398 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_ END399 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_BEGIN 399 400 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 400 401 USB_HID_REPORT_TYPE_INPUT); 401 402 402 unsigned int key;403 // unsigned int key; 403 404 404 405 /*! @todo Is this iterating OK if done multiple times? … … 409 410 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value, 410 411 field->usage); 411 412 key = field->usage; 413 //key = usb_lgtch_map_usage(field->usage); 414 usb_lgtch_push_ev(hid_dev, KEY_PRESS, key); 412 413 // key = usb_lgtch_map_usage(field->usage); 414 // usb_lgtch_push_ev(hid_dev, KEY_PRESS, key); 415 415 416 416 field = usb_hid_report_get_sibling( 417 hid_dev->report, field, path, USB_HID_PATH_COMPARE_ END417 hid_dev->report, field, path, USB_HID_PATH_COMPARE_BEGIN 418 418 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 419 419 USB_HID_REPORT_TYPE_INPUT); -
uspace/drv/usbhid/subdrivers.c
r1989cdf rf55ded3 42 42 43 43 static usb_hid_subdriver_usage_t path_kbd[] = { 44 {USB_HIDUT_PAGE_ KEYBOARD, 0},44 {USB_HIDUT_PAGE_GENERIC_DESKTOP, 6}, 45 45 {0, 0} 46 46 }; 47 47 48 48 static usb_hid_subdriver_usage_t path_mouse2[] = { 49 {USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_X},49 {USB_HIDUT_PAGE_GENERIC_DESKTOP, 2}, 50 50 {0, 0} 51 51 }; … … 60 60 path_kbd, 61 61 -1, 62 USB_HID_PATH_COMPARE_END 63 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 62 USB_HID_PATH_COMPARE_BEGIN , 64 63 -1, 65 64 -1, … … 75 74 lgtch_path, 76 75 1, 77 USB_HID_PATH_COMPARE_END 78 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 76 USB_HID_PATH_COMPARE_BEGIN, 79 77 0x046d, 80 78 0xc30e, … … 89 87 path_mouse2, 90 88 -1, 91 USB_HID_PATH_COMPARE_END 92 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 89 USB_HID_PATH_COMPARE_BEGIN, 93 90 -1, 94 91 -1, -
uspace/drv/usbhid/usbhid.c
r1989cdf rf55ded3 199 199 mapping->report_id); 200 200 } 201 201 202 uint8_t report_id = (mapping->report_id >= 0) ? mapping->report_id : 0; 202 203 assert(hid_dev->report != NULL); 203 204 204 205 usb_log_debug("Compare flags: %d\n", mapping->compare); 205 size_t size = usb_hid_report_size(hid_dev->report, mapping->report_id,206 size_t size = usb_hid_report_size(hid_dev->report, report_id, 206 207 USB_HID_REPORT_TYPE_INPUT); 207 208 usb_log_debug("Size of the input report: %zuB\n", size); 208 209 209 210 usb_hid_report_path_free(usage_path); 210 211
Note:
See TracChangeset
for help on using the changeset viewer.