Hello,
You will find an example on the Example Program Database:
http://ae.natinst.com/devzone/explprog.nsf/41ee12ddba6c766a8625684700691463/832b604cb371a54686256540004f7b3c?OpenDocument
and I have also attached it to this response. This example uses the keyboard VIs to intercept keystrokes and then display those keys in a string indicator when the What Have I Typed? button is pressed. The example was created in LabVIEW 4.1.1, but you will be able to run it with later versions, too.
Zvezdana S.
National Instruments