12-13-2007 04:01 PM
Hello Community,
I'm trying to programmatically simulate the underscore "_" keystroke. I'm using the keybd_event from the user32.dll set-up in a call library node as follows:
void keybd_event(unsigned char bVk, unsigned char bScan, unsigned long dwFlags, unsigned long dwExtraInfo);
I found an example of what I want to do written in VC++ below, but can't understand it fully:
keybd_event(VK_SHIFT, 0, 0, NULL);
keybd_event(VK_OEM_MINUS, 0, 0, NULL);
keybd_event(VK_OEM_MINUS, 0, KEYEVENTF_KEYUP, NULL);
keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, NULL);
I understand that the first line of code above is pressing down the shift key, the second line of code is pressing down the minus key (which is the underscore key when shift is previously pressed and held down), the third line of code is releasing the minus key, and the fourth line of code is releasing the shift key.
Does anyone know how to do this in the LabVIEW programming language? What values can I send LabVIEW to mimic the VK_SHIFT and VK_MINUS values in C++? I can simulate all of the letters and numbers, but can't figure out how to simulate the underscore.
Thanks,
Andy
P.S. - I'm using the LabVIEW 7.1 Programming Language and can't migrate my code to LabVIEW 8, 8.20, or 8.5 so please don't post a solution with functionality available in LV8.x that is not available in
12-13-2007 04:07 PM
12-13-2007 10:35 PM - edited 12-13-2007 10:41 PM
Matthew K...,
Thank you for posting your keyboardEvent.vi. It helped me create the solution to my problem of simulating the "_" (underscore) keystroke programmaticlly.
I have attached the VI that I put together to verifiy that the "_" symbol was generated: