Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbd/kbddev.c

    rbd2394b r252cf2a  
    255255       
    256256        if (hid_dev == NULL || hid_dev->data == NULL) {
     257                usb_log_debug("default_connection_handler: "
     258                    "Missing parameter.\n");
    257259                async_answer_0(icallid, EINVAL);
    258260                return;
     
    267269
    268270                if (kbd_dev->console_phone != -1) {
     271                        usb_log_debug("default_connection_handler: "
     272                            "console phone already set\n");
    269273                        async_answer_0(icallid, ELIMIT);
    270274                        return;
     
    272276
    273277                kbd_dev->console_phone = callback;
     278               
     279                usb_log_debug("default_connection_handler: OK\n");
    274280                async_answer_0(icallid, EOK);
    275281                return;
    276282        }
    277283       
     284        usb_log_debug("default_connection_handler: Wrong function.\n");
    278285        async_answer_0(icallid, EINVAL);
    279286}
     
    555562                        usb_log_debug2("Key pressed: %d (keycode: %d)\n", key,
    556563                            kbd_dev->keys[i]);
    557                         usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key);
    558564                        if (!usb_kbd_is_lock(key)) {
    559565                                usb_kbd_repeat_start(kbd_dev, key);
    560566                        }
     567                        usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key);
    561568                } else {
    562569                        // found, nothing happens
     
    670677//          callbacks, kbd_dev);
    671678        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);
    673680        //usb_hid_report_path_set_report_id(path, 0);
    674681
     
    688695        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    689696            hid_dev->report, NULL, path,
    690             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     697            USB_HID_PATH_COMPARE_BEGIN,
    691698            USB_HID_REPORT_TYPE_INPUT);
    692699        unsigned i = 0;
    693        
     700
    694701        while (field != NULL) {
    695702                //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
     
    709716                 *       two parts of the Report somehow.
    710717                 */
     718                usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage);
    711719                if (field->value != 0) {
    712                         kbd_dev->keys[i] = field->usage;
     720                        //kbd_dev->keys[i] = field->usage;
    713721                }
    714722                else {
    715                         kbd_dev->keys[i] = 0;
     723                        //kbd_dev->keys[i] = 0;
    716724                }
    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]);
    718726               
    719727                ++i;
    720728                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,
    723730                    USB_HID_REPORT_TYPE_INPUT);
     731                usb_log_debug("field -- %p\n", field);
    724732        }
    725733       
     
    853861         * TODO: make more general
    854862         */
    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        
    860863        kbd_dev->key_count = usb_hid_report_size(
    861864            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);   
    866867        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    867868       
     
    979980                return rc;
    980981        }
    981        
     982
    982983        return EOK;
    983984}
Note: See TracChangeset for help on using the changeset viewer.