Wired to the Leonardo? I have seen projects where mice were Arduino-hacked and I know that PS2 mouse can be wired direct to Arduino pins.
"What I'm trying to do is if mouse left is held, I want it to consistently click until it's letten go."
Yes you can do that if you mean sending mouse and clicks as HID to the PC.
You have to use time calculations to know when the mouse button is held down and to make nice even clicks but what your sketch reads from the mouse does not control what the Leonardo sends to the PC.
GoForSmoke:
Wired to the Leonardo? I have seen projects where mice were Arduino-hacked and I know that PS2 mouse can be wired direct to Arduino pins.
"What I'm trying to do is if mouse left is held, I want it to consistently click until it's letten go."
Yes you can do that if you mean sending mouse and clicks as HID to the PC.
You have to use time calculations to know when the mouse button is held down and to make nice even clicks but what your sketch reads from the mouse does not control what the Leonardo sends to the PC.
Thank you for the reply, I'd like to re-phrase what I said.
Is there a specific function I could use to know if MOUSE_LEFT button is held?
The Arduino itself is connected to the PC directly through the micro-usb cable.
The mouse is connected to the PC, the mouse itself does not connect to the Arduino in any sort of way.
I've also accomplished the PS/2 mouse event, where I had to open inside the mouse and connect the wires to the according Arduino pins although those mouses are really old and I don't want to switch mouses.
cruisey:
The Arduino itself is connected to the PC directly through the micro-usb cable.
The mouse is connected to the PC, the mouse itself does not connect to the Arduino in any sort of way.
Your Arduino acts as a HID, your mouse acts as a HID. I doubt very much that what you want to achieve is possible without extreme effort (including writing new drivers for the mouse on the PC).
cruisey:
Thank you for the reply, I'd like to re-phrase what I said.
Is there a specific function I could use to know if MOUSE_LEFT button is held?
The Arduino itself is connected to the PC directly through the micro-usb cable.
The mouse is connected to the PC, the mouse itself does not connect to the Arduino in any sort of way.
I've also accomplished the PS/2 mouse event, where I had to open inside the mouse and connect the wires to the according Arduino pins although those mouses are really old and I don't want to switch mouses.
Thanks.
You can wire directly to the PS2 jack and interface PS2 keyboard and/or mouse without opening either device.
There's more than tutorial article in the Playground on doing just that.
I for one never tried to read the PC when using Arduino in HID mode. That doesn't mean it can't be done.