LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

keyboard \ mouse button as a latch button

hello, 

 

I have a foot pedal that is acting as a keyboard key or a mouse button.  I use it to open and close a shutter.

 

I was wondering if there is a way to program it to act as a latch button?

 

for example, if my foot pedal is the same as pressing 'K',  I want to write a 'K' when my foot is on the pedal and another 'K' when my foot is off the pedal.

 

currently, for two 'K' i need to step on it twice.

 

Avishay

0 Kudos
Message 1 of 5
(2,913 Views)

You can get this effect by using an event structure. Notice the one event that has "Key Down" and "Key Up" events. It adds a K to the string every time any key is pressed or released. You probably need to make a control sequence that identifies your foot pedal here, but it is a nudge in the right direction I think?

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 2 of 5
(2,907 Views)

@JarleEkanger wrote:

You can get this effect by using an event structure. Notice the one event that has "Key Down" and "Key Up" events. It adds a K to the string every time any key is pressed or released. You probably need to make a control sequence that identifies your foot pedal here, but it is a nudge in the right direction I think?


Can you post your code in 2013 or may be attach a snippet?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 5
(2,899 Views)

Latching Key.png

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 4 of 5
(2,895 Views)

What kind of data are you getting from the pedal?  Can you create a user event for this data and compare the new value to the previous value?  If they are the same, pedal hasn't been pressed.  If they are different pedal has been pressed....you just have to determine which way the pedal moved.

 

Edit: actually you don't care which way the pedal moved because you want a 'k' everytime.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 5
(2,861 Views)