Ignore:
File:
1 edited

Legend:

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

    r323b0ec r7304663  
    203203/*----------------------------------------------------------------------------*/
    204204/** Mapping of USB modifier key codes to generic modifier key codes. */
    205 //static const keycode_t usbhid_modifiers_keycodes[USB_HID_MOD_COUNT] = {
    206 //      KC_LCTRL,         /* USB_HID_MOD_LCTRL */
    207 //      KC_LSHIFT,        /* USB_HID_MOD_LSHIFT */
    208 //      KC_LALT,          /* USB_HID_MOD_LALT */
    209 //      0,                /* USB_HID_MOD_LGUI */
    210 //      KC_RCTRL,         /* USB_HID_MOD_RCTRL */
    211 //      KC_RSHIFT,        /* USB_HID_MOD_RSHIFT */
    212 //      KC_RALT,          /* USB_HID_MOD_RALT */
    213 //      0,                /* USB_HID_MOD_RGUI */
    214 //};
    215 
    216 //typedef enum usbhid_lock_code {
    217 //      USB_KBD_LOCK_NUM = 0x53,
    218 //      USB_KBD_LOCK_CAPS = 0x39,
    219 //      USB_KBD_LOCK_SCROLL = 0x47,
    220 //      USB_KBD_LOCK_COUNT = 3
    221 //} usbhid_lock_code;
    222 
    223 //static const usbhid_lock_code usbhid_lock_codes[USB_KBD_LOCK_COUNT] = {
    224 //      USB_KBD_LOCK_NUM,
    225 //      USB_KBD_LOCK_CAPS,
    226 //      USB_KBD_LOCK_SCROLL
    227 //};
     205static const keycode_t usbhid_modifiers_keycodes[USB_HID_MOD_COUNT] = {
     206        KC_LCTRL,         /* USB_HID_MOD_LCTRL */
     207        KC_LSHIFT,        /* USB_HID_MOD_LSHIFT */
     208        KC_LALT,          /* USB_HID_MOD_LALT */
     209        0,                /* USB_HID_MOD_LGUI */
     210        KC_RCTRL,         /* USB_HID_MOD_RCTRL */
     211        KC_RSHIFT,        /* USB_HID_MOD_RSHIFT */
     212        KC_RALT,          /* USB_HID_MOD_RALT */
     213        0,                /* USB_HID_MOD_RGUI */
     214};
     215
     216typedef enum usbhid_lock_code {
     217        USB_KBD_LOCK_NUM = 0x53,
     218        USB_KBD_LOCK_CAPS = 0x39,
     219        USB_KBD_LOCK_SCROLL = 0x47,
     220        USB_KBD_LOCK_COUNT = 3
     221} usbhid_lock_code;
     222
     223static const usbhid_lock_code usbhid_lock_codes[USB_KBD_LOCK_COUNT] = {
     224        USB_KBD_LOCK_NUM,
     225        USB_KBD_LOCK_CAPS,
     226        USB_KBD_LOCK_SCROLL
     227};
    228228
    229229/*----------------------------------------------------------------------------*/
     
    709709                 *       two parts of the Report somehow.
    710710                 */
    711                 if (field->value != 0) {
     711                if( field->value != 0 ) {
    712712                        kbd_dev->keys[i] = field->usage;
    713713                }
     
    984984        }
    985985       
    986         // free all buffers
    987         if ((*kbd_dev)->keys != NULL) {
    988                 free((*kbd_dev)->keys);
    989         }
    990         if ((*kbd_dev)->keys_old != NULL) {
    991                 free((*kbd_dev)->keys_old);
    992         }
    993         if ((*kbd_dev)->led_data != NULL) {
    994                 free((*kbd_dev)->led_data);
    995         }
    996         if ((*kbd_dev)->output_buffer != NULL) {
    997                 free((*kbd_dev)->output_buffer);
    998         }
    999         if ((*kbd_dev)->led_path != NULL) {
    1000                 usb_hid_report_path_free((*kbd_dev)->led_path);
    1001         }
    1002         if ((*kbd_dev)->output_buffer != NULL) {
    1003                 usb_hid_report_output_free((*kbd_dev)->output_buffer);
    1004         }
     986        // free the output buffer
     987        usb_hid_report_output_free((*kbd_dev)->output_buffer);
    1005988
    1006989        free(*kbd_dev);
     
    10221005                } else {
    10231006                        usb_kbd_free(&kbd_dev);
    1024                         hid_dev->data = NULL;
    10251007                }
    10261008        }
Note: See TracChangeset for help on using the changeset viewer.