LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How the keyboard activate any Ok Button?

Solved!
Go to solution


Hello NI Engineers,

I just make a program that Consist of 4 button controling 4 LEDs

The Problem is I did not want to operate the button by the mouse click but

i want to operate the button using the arrow keys in keyboard

so I want to konw...

How To activate the Ok Button (on) when press a button on the keyboard Like (Arrow keys) and

Deactivated the OK Button when you leave press the keyboard button.



Thanks alot

Abdo El-Moniem

0 Kudos
Message 1 of 10
(6,070 Views)

Use an event  structure with the  "Key Down" and "Key Up" events being processed. Use case statements to select the keys you want based on the scan codes, then use a case statement on the "Type" enum to assign values  to the front panel buttons. See the attached keyboarding.vi which shows the up arrow and  down arrow causing two different buttons to be pushed the way you want.

 

Richard

0 Kudos
Message 2 of 10
(6,067 Views)

Hi,

 

I have attached a vi. It doesn't do exactly what you want. But this can help you. In this, instead of the Latch Untill Released function which you wanted , switch function is used. The rest of the things are same. By the way I am not sure whether this is a very good way to do it but it worksSmiley Very Happy

Regards,

Nitzz

(Kudos are always Welcome, Mark as solution if it is the one:smileywink:)

0 Kudos
Message 3 of 10
(6,053 Views)

Thanks Alot for Helping me

I find The Solution Of My Problem Using the Connectivity (Input Device Control)

But I Had a Question

How To Fill The Enum Constant With The all Keys in the Keyboard of The Laptop Like This VI

I hope the answer be in Steps

Thanks again

Abdo El-Moniem

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

To get an enum constant filled with the correct set of values, right-click on a terminal (such as the output of the index array function) and select Create Constant. Also note that the example you posted does not work properly if multiple keys are pressed at once. The example that I posted does work properly even in that case.

0 Kudos
Message 5 of 10
(6,019 Views)

Thanks so much Richard

But I Can not see you VI Because I work on Labview 8.6

0 Kudos
Message 6 of 10
(6,013 Views)
Solution
Accepted by topic author frhyj 00t

Attached is a version 8.6 copy.


Richard

Message 7 of 10
(6,011 Views)

Thanks Richard

this is the best Solution

could you tel me what is the function of the Scan Code ?

IS This Function represent the ASCII Code in Decimal ?

0 Kudos
Message 8 of 10
(6,005 Views)

The scan code is a unique valuefor each key on the keyboard, even those that do not have an ASCII code (Shift, Caps Lock, etc). If you want to find the scan code for a particular key, run the example and watch the scan code indicator as you press the key.


Richard

0 Kudos
Message 9 of 10
(6,002 Views)

Thanks alot Richard for Helping me 

 

I know that I take your time

 

thanks again for finding a solution to my problem

 

..........

 

Abdo El-Moniem

0 Kudos
Message 10 of 10
(5,996 Views)