Raw reading Space Mouse Wireless

Post questions, comments and feedback to our 3Dconnexion UNIX and Linux Development Team.

Moderator: Moderators

Post Reply
Twosmaus
Posts: 7
Joined: Mon Feb 21, 2022 10:23 pm

Raw reading Space Mouse Wireless

Post by Twosmaus »

Hello i want to ask is the raw reading of space mouse wireless possible ? I want read space mouse wireless from USB HID in Android, is this possible without API or SDK just with datasheet ?

Thanks for any reply.
jwick
Moderator
Moderator
Posts: 3374
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raw reading Space Mouse Wireless

Post by jwick »

Yes, it is possible. The firmware device descriptors describe how it works. The number of axes, range, buttons. Everything you need is delivered by the firmware of USB devices.

You give up a lot of functionality by not using our driver. This is mostly, though, to support MCAD apps.
Twosmaus
Posts: 7
Joined: Mon Feb 21, 2022 10:23 pm

Re: Raw reading Space Mouse Wireless

Post by Twosmaus »

Thanks for reply. I read space mouse in raw format, it sends 12 (maybe 13 i don't remember) bytes. What does these bytes mean ? How can i get datasheet or data format information for these ?
jwick
Moderator
Moderator
Posts: 3374
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raw reading Space Mouse Wireless

Post by jwick »

The device descriptor should tell you what the number format is, but, true, it doesn't tell you what the axes mean.
This snippet show how to extract the Tx, Ty, Tz, Rx, Ry, Rz axes from a recent device:

Code: Select all

    Tx = (((short)pRpt[2]) << 8) | (unsigned char)pRpt[1];  // pan left right (MouseX)
    Ty = (((short)pRpt[4]) << 8) | (unsigned char)pRpt[3];  // pan to and fro (MouseY)
    Tz = (((short)pRpt[6]) << 8) | (unsigned char)pRpt[5];  // pan up toward ceiling / down toward desk
    Rx = (((short)pRpt[8]) << 8) | (unsigned char)pRpt[7];   // Rotate like a motorcycle throttle
    Ry = (((short)pRpt[10]) << 8) | (unsigned char)pRpt[9];   // Rotate like a door knob
    Rz = (((short)pRpt[12]) << 8) | (unsigned char)pRpt[11];  // Rotate like opening a jar of peanut butter
ngomes
Moderator
Moderator
Posts: 3390
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: Raw reading Space Mouse Wireless

Post by ngomes »

I believe we have a libusb sample that shows how to decode the raw data.

If you're interested, send a note to the API Support team. The contact details can be found here (registration is required).
Nuno Gomes
Twosmaus
Posts: 7
Joined: Mon Feb 21, 2022 10:23 pm

Re: Raw reading Space Mouse Wireless

Post by Twosmaus »

Thanks for reply
Post Reply