Skip to main content
Graduate II
September 5, 2024
Solved

Missing ESC key code in USB HID_KEYBRD_Key table array

  • September 5, 2024
  • 1 reply
  • 1057 views

The Escape key was mapped to 0x00 in the USB HID code, I added it and it works fine but I'm curious to know why it was absent?  Bug/oversight, another method used for Escape key detection?

 

 

#ifdef QWERTY_KEYBOARD
static const uint8_t HID_KEYBRD_Key[] =
{
 '\0', '`', '1', '2', '3', '4', '5', '6',
 '7', '8', '9', '0', '-', '=', '\0', '\r',
 '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u',
 'i', 'o', 'p', '[', ']', '\\',
 '\0', 'a', 's', 'd', 'f', 'g', 'h', 'j',
 'k', 'l', ';', '\'', '\0', '\n',
 '\0', '\0', 'z', 'x', 'c', 'v', 'b', 'n',
 'm', ',', '.', '/', '\0', '\0',
 '\0', '\0', '\0', ' ', '\0', '\0', '\0', '\0',
 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
 '\0', '\0', '\0', '\0', '\0', '\r', '\0', '\0',
 '\0', '\0', '\0', '\0', '\0', '\0',
 '\0', '\0', '7', '4', '1',
 '\0', '/', '8', '5', '2',
 '0', '*', '9', '6', '3',
 '.', '-', '+', '\0', '\n', '\0', '\e', '\0', '\0', '\0', '\0',	/* Modification - changed \0 to \e for Escape key detection */
 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
 '\0', '\0', '\0', '\0'
};

 

 

    This topic has been closed for replies.
    Best answer by FBL

    Hi @Robmar 

    We can confirm HOST MW for HID class will be updated.

    STM32CubeH7/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid_keybd.c at d76ccdf6165bdf31d3718ae4722aa23bd15cc582 · STMicroelectronics/STM32CubeH7 (github.com)

    Internal ticket is submitted to MW team: 190619

    1 reply

    FBLAnswer
    Technical Moderator
    September 10, 2024