Just to check that I understand what you are trying to do
- The Arduino (which board do you have) is connected to the PC via a USB port
- The mouse is connected to the PC
- When you click the right button of the mouse you want the Arduino to send the '5' character as if it had been typed on the PC keyboard
- the sketch that you posted sends a '5' to the PC when you click the left mouse button
Is that correct ?