LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to use the F keys?

Well, I've found VIs that display the current key pressed, but none of the F keys seem to register. Does Labview even recognize these keys??

0 Kudos
Message 1 of 10
(3,001 Views)

The key down? event seems to handle the F keys just fine.

 

So does the key down event, but LV will still handle the default behavior, like open the help. But you do get an event.

 

The problem with the "other VIs" is probably that they only look at the char value of the event. You need to consider the VKey.

0 Kudos
Message 2 of 10
(2,993 Views)

Here is an example:

 

example.png

 

Look at the scan code

Tim
GHSP
0 Kudos
Message 3 of 10
(2,987 Views)

wiebe@CARYA wrote:

The problem with the "other VIs" is probably that they only look at the char value of the event. You need to consider the VKey.


Or scan code...

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

Yes it does,

 

Place an event structure, add an event for Key Down

"Char" it will give you the ASCII code for the key pressed

"VKey" will give you Esc, Enter, Shift, Ctrl,..., etc. F1, F2,... F12, etc. 

 

Saludos.

0 Kudos
Message 5 of 10
(2,982 Views)

Well, the KeyDown field in the LabVIEW Event structure (present for at least as long as I've been using LabVIEW) provides a lot of data (some of which you might need to look up/research):

KeyDown Event Field.png

 

Bob Schor

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

wiebe@CARYA wrote:

wiebe@CARYA wrote:

The problem with the "other VIs" is probably that they only look at the char value of the event. You need to consider the VKey.


Or scan code...


That works until someone changes their layout to Dvorak or some custom keyboard. 🙂 (A colleague build 4-row keyboards instead of the common 6 rows where e.g. 1-0 is on the Q-P keys with a modifier.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 10
(2,889 Views)

Keyboards such as this. 🙂

103391-kumo1.jpg

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

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 10
(2,871 Views)

@Yamaeda wrote:

wiebe@CARYA wrote:

wiebe@CARYA wrote:

The problem with the "other VIs" is probably that they only look at the char value of the event. You need to consider the VKey.


Or scan code...


That works until someone changes their layout to Dvorak or some custom keyboard. 🙂 (A colleague build 4-row keyboards instead of the common 6 rows where e.g. 1-0 is on the Q-P keys with a modifier.

/Y


Well, it depends on what you want. If you want to catch a press of a specific physical key (regardless how it's configured or interpreted in the OS), the scan code should be used. Not sure if I've seen a practical use case, but I'm sure they are there.

Message 9 of 10
(2,867 Views)

The 1st thing that comes to mind is default setup for a game. Imagine the WASD on a Dvorak ... 🙂 If you map through scancode you'd get the right positions as default.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 10 of 10
(2,861 Views)