Ignore:
File:
1 edited

Legend:

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

    r252cf2a rbd2394b  
    255255       
    256256        if (hid_dev == NULL || hid_dev->data == NULL) {
    257                 usb_log_debug("default_connection_handler: "
    258                     "Missing parameter.\n");
    259257                async_answer_0(icallid, EINVAL);
    260258                return;
     
    269267
    270268                if (kbd_dev->console_phone != -1) {
    271                         usb_log_debug("default_connection_handler: "
    272                             "console phone already set\n");
    273269                        async_answer_0(icallid, ELIMIT);
    274270                        return;
     
    276272
    277273                kbd_dev->console_phone = callback;
    278                
    279                 usb_log_debug("default_connection_handler: OK\n");
    280274                async_answer_0(icallid, EOK);
    281275                return;
    282276        }
    283277       
    284         usb_log_debug("default_connection_handler: Wrong function.\n");
    285278        async_answer_0(icallid, EINVAL);
    286279}
     
    562555                        usb_log_debug2("Key pressed: %d (keycode: %d)\n", key,
    563556                            kbd_dev->keys[i]);
     557                        usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key);
    564558                        if (!usb_kbd_is_lock(key)) {
    565559                                usb_kbd_repeat_start(kbd_dev, key);
    566560                        }
    567                         usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key);
    568561                } else {
    569562                        // found, nothing happens
     
    677670//          callbacks, kbd_dev);
    678671        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);
    680673        //usb_hid_report_path_set_report_id(path, 0);
    681674
     
    695688        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    696689            hid_dev->report, NULL, path,
    697             USB_HID_PATH_COMPARE_BEGIN,
     690            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    698691            USB_HID_REPORT_TYPE_INPUT);
    699692        unsigned i = 0;
    700 
     693       
    701694        while (field != NULL) {
    702695                //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
     
    716709                 *       two parts of the Report somehow.
    717710                 */
    718                 usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage);
    719711                if (field->value != 0) {
    720                         //kbd_dev->keys[i] = field->usage;
     712                        kbd_dev->keys[i] = field->usage;
    721713                }
    722714                else {
    723                         //kbd_dev->keys[i] = 0;
     715                        kbd_dev->keys[i] = 0;
    724716                }
    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]);
    726718               
    727719                ++i;
    728720                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,
    730723                    USB_HID_REPORT_TYPE_INPUT);
    731                 usb_log_debug("field -- %p\n", field);
    732724        }
    733725       
     
    861853         * TODO: make more general
    862854         */
     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       
    863860        kbd_dev->key_count = usb_hid_report_size(
    864861            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       
    867866        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    868867       
     
    980979                return rc;
    981980        }
    982 
     981       
    983982        return EOK;
    984983}
Note: See TracChangeset for help on using the changeset viewer.