LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set the letter 'a' to toggle or control a Boolean Button.

Solved!
Go to solution

My question seems simple but I have not found a solution to it. My problem is I have a Boolean Button and I want to control this button my pressing the letter 'a' on my keyboard. For example, I hold down the letter 'a' on my keyboard and the button is depressed until I release the button on my keyboard. I kow that LabVIEW have the Key Navigation, but all of those are the Function Keys and odd sysbols. I jsut need to use the letter 'a.' Ideas?

0 Kudos
Message 1 of 10
(4,469 Views)

Use an event structure with "key down" and "key up" events and then filter for the letter "a".

0 Kudos
Message 2 of 10
(4,463 Views)

Well I am using an even structure already. Here is a clip of that section that I am reffering to. What do you mean by filter?

0 Kudos
Message 3 of 10
(4,459 Views)

In total I want to have 8 different letters controlling 8 different buttons.

0 Kudos
Message 4 of 10
(4,458 Views)

Here's a simple example (LV 2010) to enable a boolean with the "a" key. See if you can take it from here.

 

(also, please attach real code instead of pictures. An image never tells the full story)

Message 5 of 10
(4,454 Views)

That you for the help. Here is what I tried to do. What did I do wrong? It seems as if the exevnt loop is not even being initiated at all. The ascii number for 'a' is 61 I dont understand why in your exmaple it is 30. PLease explain. Thank You very much

0 Kudos
Message 6 of 10
(4,413 Views)

You need to catch the Keydown-event to capture key presses.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 10
(4,405 Views)

@Andrew Hensley wrote:

That you for the help. Here is what I tried to do. What did I do wrong? It seems as if the exevnt loop is not even being initiated at all. The ascii number for 'a' is 61 I dont understand why in your exmaple it is 30. PLease explain. Thank You very much


Of course the event fires when you press "a", however you have no way to tell unless you look at the string sent to the TCP/IP.

 

Is there a device with name jjj listening on port 555? (What is the significance of the 555ms timeout?)

 

The scancode gives a unique number for each key on the keyboard. it is unrelated to ASCII codes. Easiest would be to place an indicator on the scancode wire and press all the buttons you need while noting the resulting number. should take less than a minute. 😉

0 Kudos
Message 8 of 10
(4,391 Views)

Yes I have a device listening on there. I just removed my ip address that I had in there and put in a fake port number when I posted. So the valuse of the key pressed it auto matically sent with this configureation?

0 Kudos
Message 9 of 10
(4,382 Views)
Solution
Accepted by Andrew_Hensley

@Andrew Hensley wrote:

So the valuse of the key pressed it auto matically sent with this configureation?



Don't ask me, try it! 😄

0 Kudos
Message 10 of 10
(4,376 Views)