tags:

views:

1548

answers:

5

A friend of mine asked me to implement a blue and a red pointer to represent the inputs of two separate mice to expedite a mixing desk scenario for real time audio mixing. I'd love to, but as much as I think it is a great idea, I don't have a clue as to where to start looking for a possible solution.

Where should I start researching a viable method of implementing dual mouse inputs?

+3  A: 

dont know about java.. but for C#/c++ you can try the Microsoft Windows MultiPoint Software Development Kit

i've tried it on windows.. it works with 2 USB mice.

ShoeLace
+5  A: 

Look at jinput.

I have had multiple keyboards working with it, I am nearly certain it supports multiple mice too.

Paul Whelan
I agree with Paul. In fact, a little digging around in the JInput forums throws up this:http://www.javagaming.org/index.php/topic,16681.0.html
Keith Lawrence
A: 

You can use multiple devices, but at the Java level, all mouse events are coalesced into a single stream. The event does not include which mouse it came from. You did say you wanted to mix audio, right? Well this mix might be interesting, but surely not what you want.

I'd suggest using the Java-supported midi interface and connecting some simple midi controller device with multiple knobs or trackballs. These will come in as midi events, and you can examine the state for the details you need.

dongilmore
+3  A: 

It depends on which operating system you intend to use.

On Windows, you can use:

  1. CPNMouse - a driver+software combination, very flexible and allows to completely hide some of the mice from the operating system.
  2. RawInput - an API provided by Windows XP only. You can use it to distinguish between two mouse inputs, draw the cursors yourself and hide the main cursor. Take a look at the code of SDGT, a C# usage of this API.
  3. For both solutions you would have to build a JNI bridge to your application

If you are using X.Org (X11) server, there is patched version called MPX that should support multiple mice even for legacy applications. It should now be a part of the X.Org trunk, but I'm not very familiar with it. Anyway it has an API so you can use it via JNI bridge.

kshahar
A: 

Maybe it's a weird question, but i'm still a newbie. Btw, how to detect mouse device with JInput in JAVA ??? Because i've to make application which can show two mouse pointer in one screen ?? Thanks before...

rpurnama