LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

recover mouse output

Hello,

First of all, I apologise for the dual post (in french community) but I think my problem will have more visibility on the main forum about LabVIEW.

I'm working on a application in which we have two mouses connected to the computer. The mouse 1 drives the cursor as usually. The mouse 2 doesn't have to drive the cursor but i still want to recover its (x,y) move.

However when you plug two USB mouse, both of them drive the cursor.

My idea is to "catch" the signal from mouse 2 and to "inhibit" its action in windows. I want to use its (x,y) move in other part of my programme.

My problem is that I have no idea how to do this ! I know how to handle DLL as SetCursorPos etc... but i don't know to get only the (x,y) from the mouse 2.

Thank you for your help to show me clue about how to do this !

Jérôme.
0 Kudos
Message 1 of 9
(3,353 Views)
MS Windows only support 1 mouse at any given time.  It only pass 1 mouse move information to LabVIEW, and it's not telling which one.
You can't get the 2nd mouse move info only from OS, unless you build your own driver.
 
George Zou
 
George Zou
0 Kudos
Message 2 of 9
(3,339 Views)

Hello J.H.

i know that it is possible to use 2 mice on a windows system. it exist an additional driver for that, but i don´t know the link now. I´m sure you find it with google by searching for "2 mice on one PC" or something like that. But i don´t know if both mouse positions are available in LabView after installing the additional driver.

good luck

Mike

Message 3 of 9
(3,329 Views)
You probably will need to hook into DirectInput (part of DirectX), or perhaps Microsoft MultiPoint would work for you.
Message 4 of 9
(3,319 Views)

MikeS81 wrote:

Hello J.H.

i know that it is possible to use 2 mice on a windows system. it exist an additional driver for that, but i don´t know the link now. I´m sure you find it with google by searching for "2 mice on one PC" or something like that. But i don´t know if both mouse positions are available in LabView after installing the additional driver.

good luck

Mike


Mike,
 
You can connect 2 mice to one PC, but only one mouse is controlling the cursor at any given time.  If both mice are moving, only one of them gets used.
The OS might read them alternatively, but LabVIEW, or any appication window, only gets one mouse move info.
 
George Zou

 
George Zou
0 Kudos
Message 5 of 9
(3,305 Views)
Thank you for  yours answers !

Well....this appear to be not easy !

For now, i'm trying with only one mouse connected to the computer. But I don't want this mouse drives the cursor.

So is it possible to inhibit the action of the mouse in windows while recovering the (x,y) move to use it in other programme ?


Jérôme
0 Kudos
Message 6 of 9
(3,296 Views)
You can poll the cursor position with GetCursorPos.  Or you can use VIs in Input Device Control library to poll cursor position.
Not sure what do you mean by "inhibit".   Are you trying to limit the cursor move so that it won't go out of the window boundard?
 
George Zou


Message Edited by zou on 01-14-2008 05:12 PM
George Zou
0 Kudos
Message 7 of 9
(3,288 Views)
Hello George !

Actually, i want to use the mouse device but not as a classical mouse (ie the mouse doesn't have to drive the cursor). I just want to use the device function which is the "(x,y) move" to recover it in my programme.

To sum up, I'm looking for to get the (x,y) output from the mouse device, but, this is important, i want that the move of the mouse doesn't affect the cursor position.

My english is awful, I try to be as clear as possible !! 😉


Thank you again !

Jérôme.
0 Kudos
Message 8 of 9
(3,274 Views)
Hello again,

As i'm not a programmer, i'm learning C++ in order to try Microsoft Multipoint SDK. Hoping this will work well ! (and easily !! 😉 )

Jérôme
0 Kudos
Message 9 of 9
(3,238 Views)