LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan code for "LEFT ALT" key for labview 7

hello

i've recently downloaded VI file - "simulate keyboard.vi". It works properly, but I've got one problem. I don't know the scan code for LEFT ALT key. There are many keys to simulate, but there's no alt or dot. How could I generate those codes? Those which I have found on the net are not proper, and nothing is being generated. Thank you best regards.
0 Kudos
Message 1 of 6
(6,320 Views)
What does this VI do? Does it use a DLL? Are you using windows at all?
I suggest you post your VI.
In the meantime, I believe the code for left alt is 18, but I don't remember the code for dot. It should probably be the ASCII code.
If you are using a DLL which uses the windows API, you should be able to find the documentation on the MSDN. At most, you can run getkeyboardstate and press alt at the same time and see which bit changes.

___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(6,302 Views)
I've attached the simulate keyboard.vi. It uses user32.dll library, but still I can't figure out how to change the file to be able to generate ALT keystroke.
0 Kudos
Message 3 of 6
(6,293 Views)
If you google msdn and keybd_event (which is the function you're using) you will get a link to the function's page, where you can see 2 things:
A. The function has been replaced by the more complex SendInput, so it might not be supported in future versions of windows.
B. A link to the list of virtual key codes, where you can find the ALT (Hex 12), Left Menu (A4) and period (BE) Keys.

___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(6,290 Views)

Hi, I am using LV8.0.

 

I have also downloaded simulate keyboard.vi to see how to simulate an Enter Key. However, I still failed to get the Enter Key 'pressed'.

 

What my settings are: \user32.dll, keybd_event, stdcall(Winapi).

 

I also saw the example under keyboard, basic input demo.vi, but i cant figure out anything from here. Please advise any vi that i can refer to? Thanks you.

 

21509i0D18DDEAE037DA1A

 

0 Kudos
Message 5 of 6
(5,822 Views)

I have no idea how to simulate the Enter key (you can try searching Google, as this is a Windows API question), but I would start by using the value Return (13), which I assume will do what you want. I have no idea what 43 does.


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(5,806 Views)