LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Front Panel Buttons with Keyboard

Hello everyone,

 

I have attached a VI called "Buttons.vi" saved as LabVIEW version 8.0. Basically, it contains 6 buttons (up, down, left, right, in, out) that I would like to control with the keyboard's arrows (up, down, left, right) and the Keys "i" and "o" which stand for "in" and "out".

 

For example, if the user presses the left arrow on the keyboard, I would like the left button to be pressed, etc. I'm using LabVIEW 2009 Student Edition (Mac OS X). PLEASE feel free to modify the attached file or PLEASE give me some advice on how to do it.

 

Thank you A LOT in advance!!!

0 Kudos
Message 1 of 6
(3,769 Views)

Hi Argon,

 

use an event structure and set it up to catch keypresses. Now you can filter for each key and start the actions needed...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,767 Views)

So you basically want us to do all your work for you?

 

To respond to the keyboard you need to handle the "Key Up"/"Key Down" events.  Look up in the Help and the examples on using the Event Structure. Also do a search on this forum, as this question has come up often. That will do exactly what you need. If you get stuck, post back with what you've done and we can provide more assistance. 

0 Kudos
Message 3 of 6
(3,765 Views)

Hint:

Connectivity>Input Device...xxx

 

Hummer1

 

Message 4 of 6
(3,747 Views)
Sorry, couldn't help myself.
Message 5 of 6
(3,745 Views)

Thank you ALL for your fast reply. I really appreciate it!!!

 

The problem I have is that I'm using LabVIEW 2009 Student Editions (Mac OS X) and apparently the "Initialize Keyboard.vi"and the "Acquire Input Data.vi" do NOT come standard with the Mac version of LabVIEW 2009. For some reason, some of the VIs and modules ARE supported, but do NOT come standard with the installation DVD. Last week, I contacted NI and they sent me a DVD with the MathScript RT Module (for Mac OS X).It would have been easier to post it online, but they decided to send me a DVD all the way from Ireland (it was free, so I REALLY like NI's customer service).

 

Is there any other way to capture the keyboard presses without the "Initialize Keyboard.vi"and the "Acquire Input Data.vi" VIs? Can someone PLEASE attach them? I believe LabVIEW is cross-platform so I should be able to use VIs from the Windows version on my Mac as well.

 

BTW, smercurio_fc I was not expecting for you guys to do all the work. I did see search the forum and found several threads with similar questions, but I guess I did not provide enough details about my situation. I apologize if it sounded like that.

 

THANKS EVERYONE AGAIN. Support from people like you throughout the last few years has made a HUGE difference!!!

0 Kudos
Message 6 of 6
(3,721 Views)