LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean key mapping

I would like to know if it is possible to map a usb joystick button to a boolean toggle. Then instead of, or in addition to a left mouse click, a specific usb joystick button push would change the state the toggle. It is possible to map keyboard keys. I have mapped a toggle switch to the home key for instance. If the toggle opperation is set to switch when relaesed, the toggle is flipped when I push the home key. It stays in its current state until I push the home key again. I selected the home key from a menue in the "key navigation" tab of the toggle switch property menu, but the joystick buttons are not options. If it is not possible to map to a usb joystick button to a boolean switch, is there a way to replicate the "switch when released" opperation logic of the boolean switches? For example, when a mapped usb joystick button is pushed, a register is set to "true" until that same button is pushed again.

 

 

Thanks for any advice,

 

Ian

0 Kudos
Message 1 of 13
(3,375 Views)

I assume you have the ability to read the joystick?  You could read the buttons from the joystick and then manipulate the boolean controls based on those settings.  Is that what your trying to do?  Relatively simple if I understand you correctly.  The booleans would act in place of the joystick controls, thereby emulating there behavior.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 2 of 13
(3,356 Views)

Search LabVIEW for a VI called "Query Input Devices".

0 Kudos
Message 3 of 13
(3,339 Views)

Hello,

 

and thank you for the suggestions. I have found and do use the buttons.Tthe problem is that I do not know ow to have them switch rather than latch. The physical button does not stay in place when pushed down. So, if the button push is supposed to light up an LED for example, the LED is only light when I am holing the button. I would like a single physical button push and release to switch a true false condition until another push and release. When I map a keyboard key to a toggle switch with the opperation mode set to "switch when released" I get this effect. Even though I push and release the keyboard key the condition stays set to true. I can not figure out how to map a usb joystich button to a toggle switch.

 

Ian

0 Kudos
Message 4 of 13
(3,327 Views)

I was using Initialize the "Joystick.vi" and "Acquire Input Data.vi," then unbundle by name to read the status of the specific button. Is there some difference in the functionality of Query Input Devices.vi? It would be ideal if the buttons would show up as options in the drop down box in the toggle section on the key mapping tab of the toggle switches properties menu... Is it a matter of asking windows to store additional data about the usb joystick?

 

Ian

0 Kudos
Message 5 of 13
(3,322 Views)

Since you've given us the names of the VIs, how about posting them so we can take a look-see?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 13
(3,312 Views)

I don't know of any way you can bind the joystick buttons to a front panel button.

 

What I'm saying you need to do is use those VIs to poll the state of the joystick buttons.  Whenever you detect a change from false to true on the joystick button, then you programmatically toggle the front panel button either by way of a local variable or property node.

0 Kudos
Message 7 of 13
(3,309 Views)

@Ravens Fan wrote:

I don't know of any way you can bind the joystick buttons to a front panel button.

 

What I'm saying you need to do is use those VIs to poll the state of the joystick buttons.  Whenever you detect a change from false to true on the joystick button, then you programmatically toggle the front panel button either by way of a local variable or property node.


That's basically the same thing I stated earlier.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 8 of 13
(3,305 Views)

@MoReese wrote:

@Ravens Fan wrote:

I don't know of any way you can bind the joystick buttons to a front panel button.

 

What I'm saying you need to do is use those VIs to poll the state of the joystick buttons.  Whenever you detect a change from false to true on the joystick button, then you programmatically toggle the front panel button either by way of a local variable or property node.


That's basically the same thing I stated earlier.


Yes, you did.Smiley Happy

 

Somehow the OP seems to have missed that point and was still thinking they could bind a joystick to a front panel button.

0 Kudos
Message 9 of 13
(3,303 Views)

@Ravens Fan wrote:

I don't know of any way you can bind the joystick buttons to a front panel button.

 



Thanks.

0 Kudos
Message 10 of 13
(3,296 Views)