Sending keystrokes from Arduino to computer with HC-05

Hello, I've been struggling to figure this out for a while.

I want to make a wireless macro keyboard using arduino pro micro, few buttons, and an HC-05 bluetooth module which is upgraded to have HID Firmware. Once a button is being pressed down a keystroke will be sent from the HC-05 to the computer.

I'm so desperate to understand how to send the keystrokes in terms of code ?
There's the serial.write function, but why even using it in the firstplace?
I mean how does the keystrokes are being performed in the computer by just passing them through the "serial terminal"? I'm pretty sure HC-05 uses serial bluetooth communication and that there's a certain structure for the data of the keys being passed called "HID Report". However, I still can not understand how to get it all together. What is the required code for making the keystroke data going from the arduino to the bluetooth module and then to the computer.

The only tutorials I found on this are these two, one uses a really long code and the other uses a much simpler code. How did they manage to come up with such a more simple code?
Adafruit BLUEFRUIT method - the code shown here, line 147, it was all done in 11 rows of code.
HC-05 HID method - code at the end, much longer one, and the only way I found for transferring the keystrokes data uses the HC-05.

MANY THANKS !! :confused:

SpookyHeaD:
There's the serial.write function, but why even using it in the firstplace?
I mean how does the keystroke

i'm not familiar with the Bluetooth module you're using. The Adafruit link code doesn't (at least directly) use the "Serial" interface you mention.

it looks like it uses the MCP23017 expanders to read a keyboard and then uses the "BT" interface to send a Bluetooth message to the corresponding receiver. I assume it is serializing the data sent of Bluetooth.

perhaps if you posted your code or asked a more specific question.