02-22-2016 01:28 AM
Hi all,
I'm having a problem with the aquire data input function for the keyboard. I can get the VI's to work and detect if my keyboard is pressed, but for some reason the VI thinks that my keyboard is a QWERTY keyboard, while in reality it is a AZERTY. The weird part is that while I'm typing in LabView that it is in AZERTY, so only when I use the aquire data input it changes to QWERTY. Can anyone help me with this? Or does anyone have an eplanation why this happens?
Jeroen
02-22-2016 01:34 AM - edited 02-22-2016 01:35 AM
Hi Jeroen,
Can anyone help me with this? Or does anyone have an eplanation why this happens?
You could start by reading the help for this function!
It clearly states:
keys pressed indicates which keys were pressed when the VI ran. This parameter returns values associated only with US keyboards
When you use a different keyboard layout you need to convert the result of that function to your layout, using a lookup table could help here.
Why do you use this function at all? Why not use an event structure to catch "key press" events?
02-22-2016 02:40 AM
Hi GerdW,
Thanks for the speedy reply and the information! I'm quite new to using labview, and I am going to use it to automate a chemical module. It would be easier to control it with keys in stead of using a mouse to click on all the switches. And after looking around on the internet I found the aquire data input and thought that would be easy to use, but I'm going to check the "key press" event to see if it is easier to use.
Kind regards,
Jeroen
02-22-2016 02:54 AM
02-22-2016 09:17 AM - edited 02-22-2016 09:18 AM
I'm not sure what your application is, but to simplify things some times I just put a string control, and I right click it to set Update While Typing, then when the VI starts set focus to it with a property node.
With that in place if you type on the keyboard then it will be seen as a value change even on the event structure. I've done this in the past where I want to allow a barcode to be scanned, but also to allow the user to type in a number and hit enter. I then bind the OK button to the return key, so after the barcode is scanned, or after the user types it in and hits enter, the value change on the OK is triggered and the entered string is returned.
Of course sometimes this setup doesn't work, and you really do want to just user the Key Down? event on the whole VI, or use the function linked to by GerdW.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord