# Messages sent when keyboard key is pressed [closed]

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.

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

• All this stuff, including the linked documents. – JRE Jul 4 '19 at 10:39
• 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? – 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.

• Data is updated – Shavan We Jul 5 '19 at 6:51
• 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. – Justme Jul 5 '19 at 8:38
• micro controller i am used STM32 , with USB 2.0 – Shavan We Jul 8 '19 at 5:39
• 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. – Justme Jul 8 '19 at 8:02