Handling Input from QR Code Handheld Scanner

Kmcnet 946 Reputation points
2025-01-20T20:26:08.3366667+00:00

Hello everyone and thanks for the help in advance. I am developing a MVC page that accepts input from a handheld QR code scanner. What I would like to accomplish is to allow rapid input by setting the focus of the cursor and then using an onChange event or onInput event to automatically post the scanned data to the controller. The problem in trying this is that it appears the scanner works exactly like a keyboard (no surprise I guess) rather than acting like a paste event. If this is the case, I can't think of another way to handle this without the user have to hit enter after each scan. Any help would be appreciated.

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
1,035 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 70,686 Reputation points
    2025-01-20T20:43:30.6+00:00

    You can use a timer to detect the end of input, unlike a real person the characters should all be input quickly. Start the timer on the first keystroke. If you know the number of characters in the QR code you can that also check the length.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.