0

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.

Alex K.
177k32 gold badges276 silver badges299 bronze badges
asked Feb 5, 2014 at 7:44
2
  • RawInput: codeproject.com/Articles/17123/… Commented 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. Commented Feb 6, 2014 at 22:21

1 Answer 1

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.

answered Feb 5, 2014 at 8:48
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.