jQuery: Listening for automated scanner input from keyboard?
问题 I'm writing a web app for a library system with a barcode scanner attached. The scanner's input presents as keyboard input, and it's always of the form ~~[\d]+.[\d]+~~ , for example ~~470.002~~ . I want to set up a jQuery listener for scanner input, and am a jQuery novice. It should listen to all keyboard input, but only perform an action when it hears input from the scanner, and only when the scanner input has finished. This is as far as I've got (i.e. not very): //Global functions: call on