LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

more mouse buttons needed in labview

Solved!
Go to solution

When using the "Aquire Input Data" Vi in labview. Only 4 mouse buttons are able to be read. I have a mouse with more than 4 buttons. Anyone have any ideas on how to approach this. I have looked at making a visa driver but then it deletes the windows driver and I stopped there. Don't know why they limited it to 4. "Query input devices" vi shows that the mouse has eight buttons. A gaming type joystick allways displays all the buttons. I bought the mouse specifically for the application but did not check the vi as I usually use a multibutton joystick. Any help is appreciated.

0 Kudos
Message 1 of 15
(5,493 Views)

How does the Mouse Manufacturer manage this?  I've had mice with extra buttons (and must confess that I don't ever use them), but I recall that Logitech (or whoever made the mouse) also had special software that let you set up the Mouse and "assign tasks" to the buttons.  Since I didn't make much use of this feature, I never looked "under the hood".

 

Another possibility (which you may have already alluded to, I'm not sure) is to use the VIs that LabVIEW provides for Joysticks, which (I think) also include Mouse and Keyboard.  Might they support the extra buttons, similar to the Joystick support?

 

Bob Schor

0 Kudos
Message 2 of 15
(5,462 Views)

Labview aquire input data Vi only support 4 mouse buttons. Their function needs to be updated to use more buttons. Any help is appreciated.

0 Kudos
Message 3 of 15
(5,449 Views)

 "Query input devices" vi shows that the mouse has eight buttons

0 Kudos
Message 4 of 15
(5,441 Views)

@cprince wrote:

 Any help is appreciated.


Did you try the help Bob offered?

0 Kudos
Message 5 of 15
(5,433 Views)

Labview Vi's only provide 4 button outputs no matter how you configure the mouse.

0 Kudos
Message 6 of 15
(5,417 Views)

I appreciate Bob's time but he did not offer any information that I am not already aware of.

0 Kudos
Message 7 of 15
(5,415 Views)

@cprince wrote:

Labview aquire input data Vi only support 4 mouse buttons. Their function needs to be updated to use more buttons. Any help is appreciated.


If you want new LabVIEW functionality, you need to post your request in the LabVIEW ideas exchange.

 

If there is sufficient interest, it might get implemented in the future.Good luck!

 

(Personally I stick to two buttons because that works even on the simplest netbook. Having the customer buy a special mouse just to use your application limits the universal usability :D)

0 Kudos
Message 8 of 15
(5,408 Views)

Mouse would be supplied with the system.

 

What would be great is someone who is quite familiar writing dlls and functions as well as decompiling them to go in and modify the lvinput.dll to call another function that pulls all the mouse button info. Basically just increase the number of arguments in the getMouseState function to add more buttons. Someone who knows the stuff and has the tools at hand could knock it out quickly. But I usually don't have to get that far down into the programming to get the job done so it would be quite a headache for me.

 

So anyone up for the challenge? You could probably submit it to NI to update in the future.

0 Kudos
Message 9 of 15
(5,403 Views)

I thought I'd asked if CPrince had tried the Query Input Devices VI that LabVIEW supplies for Mouse, Keyboard, and Joystick.  He (or she) didn't directly answer, so I tried it, myself.

 

There are two relevant functions here -- Query Input Devices and Acquire Input Data.  The first (on my system) returns Mouse information that clearly says that my Mouse has 8 buttons (I only see 5 -- left, middle, right, and two "thumb" buttons that I never use).  The second, when wired for a Mouse, returns a type called Cluster Button Info, a Cluster of 4 Booleans.

 

Delving a little further, Acquire Input Data is a Polymorphic Function that can, in fact, return a Cluster of 32 Buttons (which it does for Joysticks).  However, the Mouse "version" calls getMouseStateBothMode from the lvinput dll.  This function returns an Array, but the LabVIEW "Mouse Acquire" function then goes ahead and shoehorns the Array into a 4-element Cluster.

 

So I did an experiment -- I said "Use an 8-element Cluster instead", just to see what happened.  I was able to see four of the 5 Mouse Buttons respond, but not the fifth.  It does seem like the LabVIEW lvinput dll is, indeed, only returning 4 of the 8 buttons the Query Input Devices says the Mouse supports.

 

Time for an Idea Exchange notice.

 

Bob Schor

 

 

0 Kudos
Message 10 of 15
(5,388 Views)