Changes in uspace/drv/usbhid/kbd/kbddev.c [323b0ec:7304663] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbd/kbddev.c
r323b0ec r7304663 203 203 /*----------------------------------------------------------------------------*/ 204 204 /** 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 = 3221 //} 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_SCROLL227 //};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 }; 228 228 229 229 /*----------------------------------------------------------------------------*/ … … 709 709 * two parts of the Report somehow. 710 710 */ 711 if (field->value != 0) {711 if( field->value != 0 ) { 712 712 kbd_dev->keys[i] = field->usage; 713 713 } … … 984 984 } 985 985 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); 1005 988 1006 989 free(*kbd_dev); … … 1022 1005 } else { 1023 1006 usb_kbd_free(&kbd_dev); 1024 hid_dev->data = NULL;1025 1007 } 1026 1008 }
Note:
See TracChangeset
for help on using the changeset viewer.