05-03-2011 09:21 PM
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
Solved! Go to Solution.
05-03-2011 10:32 PM
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
05-04-2011 01:33 AM
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 works
Regards,
Nitzz
(Kudos are always Welcome, Mark as solution if it is the one)
05-04-2011 12:36 PM
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
05-04-2011 01:19 PM
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.
05-04-2011 01:36 PM
Thanks so much Richard
But I Can not see you VI Because I work on Labview 8.6
05-04-2011 01:48 PM
Attached is a version 8.6 copy.
Richard
05-04-2011 02:13 PM
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 ?
05-04-2011 02:23 PM
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
05-04-2011 02:49 PM
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