RawInput /Raw Input / WM_INPUT Examples

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

Moderator: Moderators

Prometheus
Posts: 1
Joined: Tue Dec 09, 2014 2:08 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by Prometheus » Thu Dec 18, 2014 9:24 am

Hey,

i want to write a DLL which is loaded by an other application ("V-rep") in C++11. Therefor i need to read button events and movement data from the spacemouse.
Sadly, I am not allowed to use unicode (have to use multybyte). Also I have no handle to the window (hwnd). "V-Rep" uses OpenGL and Qt.

So far I poked around in the two given samples of the sdk. Added the includes and the correct libs, but encountered a variaty of different dead-ends so far.

Does anyone have any recommendations which exampleproject I should try to adapt from to or additional documentation?
I never worked this close the hardware before. No idea how I can access data from a driver (or even the background service!?)

Best regards
Prometheus

jwick
Moderator
Moderator
Posts: 2565
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: RawInput /Raw Input / WM_INPUT Examples

Post by jwick » Fri Dec 19, 2014 2:58 am

You do have many options.
If you are injecting your DLL, or getting V-rep to load it, you probably don't have control over the window that will be in focus. The events are delivered though that window.
You need other options.

a) You can often get the hwnd of the main window and break into that window's event loop to look at the messages that it is receiving. There are Windows ways of doing this and usually APIs expose something similar. If you can do this you can use any of the APIs that require an hwnd. Such as the 3DxWare API (SiOpen...).

b) You create your own window. Even though it doesn't get displayed, it still can get events.

c) You can use an API that doesn't require an hwnd, such as HID.

d) You can create your own IPC mechanism, such as named pipes, and tell the driver to use it when v-rep is in focus.

Toolsoft
Posts: 15
Joined: Sun Feb 08, 2015 3:02 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by Toolsoft » Sun Feb 08, 2015 6:10 am

Hi,

i am new here.
Where to find the code examples?
The FTP server is still not active, how to get the sample code?

Thanks for informations.

UtaSH
Moderator
Moderator
Posts: 3292
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Re: RawInput /Raw Input / WM_INPUT Examples

Post by UtaSH » Mon Feb 09, 2015 7:00 am

I sent you a PM with the links.

Toolsoft
Posts: 15
Joined: Sun Feb 08, 2015 3:02 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by Toolsoft » Tue Feb 10, 2015 4:29 pm

Thanks @UtaSH

I want the minimum installation.

My wishes are
-no 3dconnexion installation (from CD or something else)
-only start my EXE
-i don't the have the automatic "drifting"-reset
-i want to work with the 3D wireless Spacemouse
-Developing Enviroment is Visual C++ 6.0 or Visual C++ 2008
-is it possible with "HID"-code?
-needed functions: translation,rotation,batterie,reset

Is it possible to get this, or more details how to do?

Thanks

jwick
Moderator
Moderator
Posts: 2565
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: RawInput /Raw Input / WM_INPUT Examples

Post by jwick » Wed Feb 11, 2015 1:24 am

Yes, you can do all that with HID. The driver uses HID to talk to the device.
RawInput is easier to use. But you won't get battery information through it. You only get translation and rotations.

Toolsoft
Posts: 15
Joined: Sun Feb 08, 2015 3:02 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by Toolsoft » Wed Feb 11, 2015 4:48 am

@jwick Thanks for Information.

Ok, nice.
Can you send me sourcecode sample with HID communication in Visual C++?

aurialLoop
Posts: 1
Joined: Tue May 10, 2016 8:33 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by aurialLoop » Tue May 10, 2016 8:45 am

Hi there,

I'm working on an app that needs to process input from 1 or more of your 3D mice and will send that information via OSC to any listening applications. The crux of this approach is that the application that is receiving this input will lose focus, so I believe I can't use the hwnd approach in your SDK. I've read in your forums and it appears that using raw input, by interfacing directly with the HID is the way to go for this problem in Windows. Can you send me the links necessary to access these examples?

Thank you.

naccyde
Posts: 1
Joined: Tue Jul 26, 2016 1:31 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by naccyde » Tue Jul 26, 2016 1:33 am

Hello,

I have got the same problem. I must use the SpaceNavigator with the Windows Raw Input API, the FTP is not available anymore, is there any example ?

Thank you.

Comsol
Posts: 1
Joined: Mon May 15, 2017 1:18 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by Comsol » Mon May 15, 2017 2:00 am

Can anyone post the link to WM_INPUT example for HID?
Is there any example how to translate the Translation and Rotation into the camera's transformations?
That will be fruitful to see how it works like in your Navigation Demo, including the handling of the Rotation Center.

bodopoq
Posts: 2
Joined: Mon May 27, 2019 10:38 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by bodopoq » Mon May 27, 2019 10:46 am

I'm trying to read controller data from the Windows' Raw Input API data structures, but have had no luck so far. Where should I specifically look and what should I expect to find? My device is SpaceTraveler3 USB (USB\VID_046D&PID_C623&REV_0311).

bodopoq
Posts: 2
Joined: Mon May 27, 2019 10:38 am

Re: RawInput /Raw Input / WM_INPUT Examples

Post by bodopoq » Fri Jun 07, 2019 1:56 pm

Nobody can help me? Am I in the wrong place? :P

Post Reply