Hi Tom,
The behavior you mention is implemented in USB_DeviceHidKeyboardAction(void) in hid_keyboard.c
Please take the following code as an example of how you can send data by pressing SW1 and SW3 of your board.
static usb_status_t USB_DeviceHidKeyboardAction(void)
{
s_UsbDeviceHidKeyboard.buffer[2] = 0x00U;
if (g_Button1Press)
{
s_UsbDeviceHidKeyboard.buffer[2] = KEY_A;
g_Button1Press = false;
}
if (g_Button3Press)
{
s_UsbDeviceHidKeyboard.buffer[2] = KEY_B;
g_Button3Press = false;
}
return USB_DeviceHidSend(s_UsbDeviceComposite->hidKeyboardHandle, USB_HID_KEYBOARD_ENDPOINT_IN,
s_UsbDeviceHidKeyboard.buffer, USB_HID_KEYBOARD_REPORT_LENGTH);
}
I hope this helps you.
Best regards,
Felipe
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------