0

There is osgGA::GUIEventAdapter in OpenSceneGraph that could detect mouse events. However, I want the program to detect two mice on the same computer and the program can only treat two mice as one. I know there is a Windows MultiPoint Mouse SDK, but I think it is used in WPF with C#, not sure if it could be used in C++

Also, there is a GlovePie, but it is not open source and not sure how to use that in vs2010.

VRPN may be a good choice, but do not know exactly how to implement two mice. Get the dll files of two mice and extract functions by vrpn?

genpfault
  • 51,148
  • 11
  • 85
  • 139
lightrek
  • 951
  • 3
  • 14
  • 30

1 Answers1

1

Take a look at "Raw Input" (http://msdn.microsoft.com/en-us/library/windows/desktop/ms645543(v=vs.85).aspx)

From that page:

An application can distinguish the source of the input even if it is from the same type of device. For example, two mouse devices.

GuyRT
  • 2,919
  • 13
  • 8
  • So, you mean I have to use MFC and write VC++ interface and embed OpenGL into the GUI? – lightrek Nov 12 '13 at 06:21
  • You don't need to use MFC - those are just win32 API calls. At application startup you need to call `RegisterRawInputDevices`, then respond to `WM_INPUT` messages in the message-handling loop. Sorry - I don't know about OSG or how this would fit into your application. – GuyRT Nov 12 '13 at 09:50
  • I encountered a problem: I have to use MainWndProc (HWND hwnd, UINT nMsg, WPARAM wParam, LPARAM lParam) in order to get the WM_INPUT message? – lightrek Nov 19 '13 at 19:10