Hello there . I'm very new to Arduino. As long as I press the right button of my mouse connected to my computer via USB, I want it to type the number 5 from the keyboard. I was able to do this with NumLock without using any pins, but I cannot do it with the right mouse button. Can you help with a simple explanation?
Example my code now =
#include <HID-Project.h>
void setup() {
Keyboard.begin();
Mouse.begin();
}
void loop() {
if (BootKeyboard.getLeds() & LED_NUM_LOCK) //Mouse.İsPress now work
{
Keyboard.press('5');delay(100);Keyboard.release('5');delay(100);
}
}
In order for the Arduino to detect a click on a mouse connected to the PC there needs to be some software running on the PC to pass it to the Arduino. Do you have such software installed ?
No . Only Arduino İDE software running .
I want the fee connected to my computer via usb to press the numbers 5 from the time path in my list on the right. detects capslock led but not mouse detect
For me, it seems to be quite clear what OP wants / needs. A mouse press on the PC arrives (in some way) in the Arduino and the Arduino sends a character.
That first part would be similar to the getLeds() method which (I think) interrogates the PC. I do not know enough about USB (read: nothing) to be able to say if the first part is possible without additional software on the PC.
Now the question is why the OP wants to use an Arduino to achieve this. It would be a million times easier to detect a mouse press in software on the PC and and let that software type the character (e.g. on the screen).
Hello, my requests are very clear and precise. Reading is also clear in the codes I have forwarded. Not only with the control capslock that will start and stop the keypress, the mouse right click will sound that's all.