01-27-2017 07:26 AM
Hi everyone,
As is montionned in the subject, i want to test if a specefic key of the keyboard is pressed, for example i want to know if the key "A" is pressed or "Z" or "3" ??
can anyone help with this please
Best regards
Solved! Go to Solution.
01-27-2017 10:20 AM
Use an event structure, similar to this.
01-27-2017 10:27 AM
Option 1:
Labview event structure, register event for This VI -> Key down. Then check by ascii code.
Option 2:
Check keyboard using Connectivity -> Input device control > Initialize keyboard function and Acquire input data function.
I use 2 if I need to check once, or to verify button is still pressed, because event is registered for VI, so if it is not in focus, it will skip it.
01-30-2017 02:49 AM - edited 01-30-2017 02:51 AM
thks aputman for the solution it works perfectelly, but there is a little issue, i want that the booleen turns to false when i release the key, or it turns automatically to false after a bit of time, is that possible ??
01-30-2017 02:59 AM
01-30-2017 03:59 AM
Hi GerdW,
In fact it is my first time using the event structure, but i found a soluion for the problem, it can be handled with the timeout event, thnks for answering anyway 😉
01-30-2017 08:45 AM
I wouldn't recommend putting the key up detection in the timeout case. What happens if you decide you want to make the timeout longer for some reason? There is a specific event, as Gerd suggested, for detecting when the key is released. Use it.