07-02-2012 03:23 PM
HI,
I'm looking to use Labview to capture a keyboard event directed to another application to trigger an output of a DAQ device. This requires the other application to have focus and the labview app to be in background.
I think that using the 'SetWindowsHookEx' function from user32.dll might work? Has anyone used this function in LV before? Or is there another way to capture global keyboard events? Thanks.
-Joe
07-02-2012 11:08 PM
It's not easy to use the hook function.
Alternatively, you can use the Input Device Control VIs (on the function palette, Connectivity => Input Device Control palette).
07-03-2012 02:14 PM
You may also find this community example useful: https://decibel.ni.com/content/docs/DOC-13648
Regards,
Brice Sorrells
Systems Engineer
National Instruments
07-09-2012 09:48 AM
Thanks for the ideas. I will probably go with the Device Control VIs. I don't think I've ever used them before; it appears that you have to poll the output (as opposed to using events)? Thanks.
-Joe
07-09-2012 10:13 AM
That's right. You have to poll. But it's a lot easier to code, and DEBUG!