Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

The "Acquire Input Data.vi" does not recognize the keyboard layout correctly.

Solved!
Go to solution

The "Acquire Input Data.vi" recognizes the keyboard layout as an English layout, although the layout is actually German.

The Expectation Value:
- The "Acquire Input Data.vi" automatically recognizes the currently active keyboard layout. (under Windows any keyboard layout can be selected).

Keyboard layout not recognized correctly.png

Questions:
- Why does "Acquire Input Data.vi" not recognize the keyboard layout correctly? What should be done about it?
- There is a "Language Identifier Constants and Strings Table" from Microsoft. Should the table be used? If so, then I have unfortunately not understood how.

 

Additional info:

LabVIEW 2016
Windows 10-64bit (image 1809)

 

Thank you in advance for your support!

0 Kudos
Message 1 of 6
(3,643 Views)
Solution
Accepted by topic author zoom_007

You can review the code in the Acquire Input Data VI. You will find that a DLL call returns a key state. As i understand the documentation in the VI, the state represents all keys being pressed (array). Each key pressed is represented as numeric value, i assume that this is essentially the key ID.

 

You can create a localized version of the Acquire Input Data VI by adopting (copy the VI for this!) the enum. Change the appropriate symbols like umlauts where applicable.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(3,608 Views)

Thank you, Norbert, for the advice.
Did I understand correctly that "Acquire Input Data VI" only knows the English keyboard layout by default?
I've thought about that possibility before. But I'm not enthusiastic about the idea, because it's just not known which keyboard layout the user will have.
It can be any European language, e.g. Spanish, etc.
You can imagine how much time it would take to create localized versions for all European languages. That's exactly why I thought about the Microsoft table above.

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

@zoom_007 wrote:

[...]
Did I understand correctly that "Acquire Input Data VI" only knows the English keyboard layout by default?
[...]


I'm not sure if it is indeed the complete english keyboard layout... the DLL returns a numeric value of the key being pressed. That number is converted to an enum which is defining symbols for the english keyboard layout. However, it is possible that some key IDs are not included as today you can have extended keyboards and such.

What i point out is that you can adopt the enum to any language, but again: if you do this, do it on a copy other than the original VI.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,589 Views)

Thank you, Norbert,
I created localized Acquire Input Data VI for the German keyboard layout and created a small VI to test the German keyboard layout.
Unfortunately I noticed that there are different keyboard layouts for English, German and other languages. So it won't be wrong if other people can try the German Acquire Input Data VI with their own keyboard.
I am open for constructive criticism.For test german keyboard layout.png

0 Kudos
Message 5 of 6
(3,578 Views)

Yesterday I noticed that the keyboardAcquire.vi didn't respond when I pressed the "Angle brackets ( < > )" key and thought that the problem was probably related to my laptop keyboard layout because the keyboard didn't have a full layout (only 99 instead of 105 keys). Today I reproduced the problem with three different USB keyboards (the problem can also be reproduced with the original keyboardAcquire.vi under English Windows language setting!). I ask the community to investigate the above problem. With this I would like to exclude that the problem lies only on my laptop.
Or does anyone have an explanation for the above phenomenon?

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