I'm would like to build a mouse for 3D navigation with arduino pro micro. The mouse is meant to work in conjunction with my primary mouse. (i.e. two mouse can be used at the same time, the primary mouse is used for left and right click function whereas the arduino mouse will be a mouse for moving/rotating the 3D object) I have read the documentation on mouse control library but it seems that the library can only be used to control the mouse cursor. Is there a way to make arduino appear as a secondary mouse that is independent of the primary mouse?
You only have on cursor on the screen. So, movement from any mouse is going to move that cursor. When you say "independent" what do you mean? If you have input from one mouse moving to the right and one mouse moving upward, the cursor is going to move at a 45 degree angle up and to the right because your PC combines the movements of the two mice.
That said, you can use the HID library to move a mouse either to an absolute position or relative to it's current position. Examples are in the HID library on github.
I think what OP wanted an alternate input device to send other types of events through HID
Those events would need to match what the specific software OP is using which means they are not mouse movement but other types of messages
you have the mouse wheel typically used for scrolling / zooming (or sliding your finger on the apple Magic Mouse surface)
But you can also send custom packages by leveraging the USB-HID specification. it's a self-describing packages that may contain any number of data types and formats and you only need the built-in HID driver on your computer to parse the data and enable dynamic association of such data with application functionality.
So the question for OP is can he rotate in 3D an object with the mouse and for doing so what type of input device is he using? ➜ that's what will need to be mimicked
Srolling is the only function that is not available to the HID library that I can see. But rotating objects usually involves clicking a button on the keyboard and moving the mouse. So, the function that the OP said he wants to perform shouldn't be hard to implement with the HID library and a combination of Mouse and Keyboard inputs. Both of which are possible from a single HID device.
Thanks for your reply. Actually, I would like to build a device that is very similar to 3DConnexion SpaceMouse (3D Mouse Review | 3D Connexion SpaceMouse Overview - YouTube). Um.. it is a mouse that is made for CAD application that is used for manipulating the 3D objects in the software. So this mouse is used together with a primary mouse (for left and right clicks, etc.). My guess is this spacemouse is a secondary mouse with hidden cursor running in the background (I'm not sure if there is other way to do this).
nope, that's not how it works. There is no notion of a hidden cursor secondary mouse in your OS.
it's probably seen as an USB HID ( USB human interface device class), sending events that are expected by the target software (like Game controllers or Other devices in the Wikipedia article)
that's how things like this work on your PC, Mac, Apple TV, tablets etc. You have multiple buttons, joysticks and yet everything just works - even separately from your mouse