Developing this web app, my only challenge, is to capture keyboard input from a SPECIFIC usb port. I'm trying to target a BARCODE reader that emulates a keyboard and make my web app react only to input coming from the barcode reader, and not the actual keyboard.
I know this can't be done w/o the help of a win32 application with some sort of a keyboard hook, so I'm trying to pursue this and perhaps learn a bit of whatever language I need to learn just to achieve this small part that I need, but i don't know where to start.
I know there's VB, .NET, C, etc. But For my purpose, what's the easiest language to learn for this? I don't plan to learn more than what i need to to achieve this, really...
Thanks all.
-
RawInput: codeproject.com/Articles/17123/…Alex K.– Alex K.2014年02月05日 13:15:49 +00:00Commented Feb 5, 2014 at 13:15
-
Telling people to keep their hands off the keyboard isn't sufficient? Because what you're asking for isn't possible without some really low-level hackery; the Raw Input API is the only API that tells you which device the keyboard input came from, but it doesn't work well with international keyboards or IMEs, and doesn't allow you to discard the input.Eric Brown– Eric Brown2014年02月06日 22:21:37 +00:00Commented Feb 6, 2014 at 22:21
1 Answer 1
If You want to start somewhere, I recommend using this link.
http://www.codeguru.com/cpp/w-p/system/keyboard/article.php/c5699/Hooking-the-Keyboard.htm
If this cannot halp, use this:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff540174(v=vs.85).aspx
The thing is, that first link is designed for hooking windows keyboard ( and also works here in my company, where my keyboard is usb-attached to my laptop ).
Perhaps the first one is enough. You must check it out. (Recommend to dissasemle also some c-code sections in order to check, which system-calls ( irq's on windows ) are involved.
Whether VB or C# can do the same, ..... sorry, I never tried. But c can definitely.