03-25-2020 10:44 AM
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??
03-25-2020 10:55 AM - edited 03-25-2020 10:58 AM
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.
03-25-2020 10:58 AM
Here is an example:
Look at the scan code
03-25-2020 10:59 AM
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...
03-25-2020 11:01 AM
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.
03-25-2020 08:50 PM
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):
Bob Schor
03-26-2020 03:52 AM
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
03-26-2020 07:31 AM
Keyboards such as this. 🙂
03-26-2020 08:43 AM
@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.
03-26-2020 09:33 AM
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