LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dual Keyboards - Can you detect which keyboard a keypress event occurs on?

I have two keyboards (normal keyboard and a numpad keyboard), both USB.  Is it possible to determine which keyboard a keypress event occurs on?  None of the keydown event data fields seem to be useful for this.
 
I want the user to be able to use the regular keyboard as normal, but have the LabVIEW application accept commands from the numpad keyboard.  The application would act on keypresses from the numpad keyboard, but not the normal keyboard.
 
Is this possible?
 
-Joe
0 Kudos
Message 1 of 5
(3,627 Views)
I'm not in front of LV at the moment, but I believe that one of the event structure outputs is called keycode or something similar and reflects the actual key you pressed. You should check whether this is different for the numpad numbers and the standard keyboard numbers.

Note that this probably varies between OSs, etc.

In any case, I don't think the OS actually provides that information at all (for example, you could also use Windows' on screen keyboard and it would function just like the other two).

___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(3,607 Views)
It's called ScanCode and it should be different, but note that it might also change between keyboards.

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

Thanks, tst.

Scancode is the same for both keyboards.  However, if I turn numlock off on one of the keyboards, and on on the other, I should be able to differentiate between the 10 numbered keys if I use both the scancode and char outputs.  I didn't want to do this because it relies on the user not changing numlock, and it only gives me use of 10 of the numpad keys.  But if thats all I can do, then I'll have to go with that.  

If anyone else has any ideas, let me know.

0 Kudos
Message 4 of 5
(3,584 Views)
Maybe something like this could be of use.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 5
(3,581 Views)