01-05-2012 02:35 AM
Hi,
I am not able to get any output out of this. Characters are just disapearing.
Some help needed please.
01-05-2012 10:38 AM
Hi,
I modified your VI and I think this will do what you want at a very basic level. There are three indicators:
1. Shows the keys that were pressed that time through the while loop
2. Shows the accumulated keys that were pressed the entire time the loop has been running
3. The spreadsheet view of all the keys pressed while the program ran
If you have any questions please let me know.
Regards,
Greg H.
01-05-2012 11:48 AM
I believe the reason you are having trouble is that you are leaving the LabVIEW environment. You will have to make windows call to do this. If you do a search I remember that altenbach had an example of using windows API call for this. I will try and see if I can find it and link it here.
01-05-2012 11:55 AM
Here is a link to the thread that I was thinking about
It is more complex and you will need to understand how to make this happen.
01-05-2012 11:57 AM
Here is another link to help. This is a link to the Microsoft MSDN
http://msdn.microsoft.com/en-us/library/ms646267
01-10-2012 03:42 AM
Hi, I am having some difficulty with what Greg proposed. See the above attachment from Greg. Each time I am typing I get several character just for the same key. Say I type A, I will get AA or AAAA ....
Anyway to fix it?
Also is it possible to stop some Y and Z key from displaying...?
Thank you.
01-10-2012 09:25 AM - edited 01-10-2012 09:26 AM
Hi,
The reason you are getting duplicates of the same key is because the loop is executing so fast it is registering each keystroke multiple times. So between when you press and release the "A" key, the program has read the current state of all the keys multiple times before the "A" key is no longer pressed. Ways to avoid this are:
1. Add a wait to the loop (however this can result in missing keystrokes entirely)
2. Compare the previous keystroke to the next and if they are the same ignore it (however if you actually press "A" then "A" it will not register properly)
3. Using a combination of 1 and 2 with either an event structure or a producer/consumer loop is probably your best bet.
Use a case structure to filter the Y and Z keys. If it is a Y or Z do not record it.
Regards,
Greg H.