Question
In the official example(Ux_Device_HID_CDC_ACM), HID device as mouse ,how to send right or left key to pc?
In the official example(Ux_Device_HID_CDC_ACM),HID devices as mouse
/* Mouse event. Length is fixed to . */
hid_event->ux_device_class_hid_event_length = 3;
/* Set X position. */
hid_event->ux_device_class_hid_event_buffer[0] = x;
/* Set Y position. */
hid_event->ux_device_class_hid_event_buffer[1] = y;
hid_event->ux_device_class_hid_event_buffer[2] = 0;/* Send an event to the hid */
ux_device_class_hid_event_set(hid, &hid_event);but i want send key(right key or left key) to pc.
so i view google
Follow the above method,i Modified code
this is
/* Mouse event. Length is fixed to . */
hid_event->ux_device_class_hid_event_length = 4;
/* Set X position. */
hid_event->ux_device_class_hid_event_buffer[0] = 2;
/* Set Y position. */
hid_event->ux_device_class_hid_event_buffer[1] = x;
hid_event->ux_device_class_hid_event_buffer[2] = y;
hid_event->ux_device_class_hid_event_buffer[3] = 0x00; /* Send an event to the hid */
ux_device_class_hid_event_set(hid, &hid_event);i tested,finded not send key to pc.
so i ask how to do send a right or left key to pc?
