When pressing keys on a keyboard what messages are sent to a PC?

Is it OK to send this message using a micro controller (through USB cable)?

This is the protocol format i got from website.

enter image description hereenter image description here

how to send these packet?

for example,

when pressing key 'A' , what commend to send pc for displaying 'A'.

if i am sending this commend using a micro controller (through USB), is it display character 'A'?

This is the document i am refer

  • \$\begingroup\$ All this stuff, including the linked documents. \$\endgroup\$
    – JRE
    Jul 4 '19 at 10:39
  • \$\begingroup\$ clearly, you have not thought about what you are asking ... you asked Is there any format? ... do you think that there is a possibility that the messges are completely random without any format? \$\endgroup\$
    – jsotola
    Jul 4 '19 at 11:49

Have you done any research about this? The microcontroller would be a USB device, enumerating has keyboard human interface device, and send messages based on this protocol.

  • \$\begingroup\$ Data is updated \$\endgroup\$
    – Shavan We
    Jul 5 '19 at 6:51
  • 1
    \$\begingroup\$ Now you changed the questions so comments already written do not match it. The packet needed to send when pressing button 'A' is in the picture. How it is sent depends on the microcontroller and what kind of USB peripheral and driver it has. \$\endgroup\$
    – Justme
    Jul 5 '19 at 8:38
  • \$\begingroup\$ micro controller i am used STM32 , with USB 2.0 \$\endgroup\$
    – Shavan We
    Jul 8 '19 at 5:39
  • \$\begingroup\$ Which STM32 then? Some of them don't even have USB so state the specific model! Have you searched if that STM32 has a keyboard HID example, or USB example how to be a USB device? I made a USB host for mass media devices for reading files with STM32F207 and it was not much of an effort due to examples and driver code provided by ST on their website. \$\endgroup\$
    – Justme
    Jul 8 '19 at 8:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.