Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use keydown isntead of keypress #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

mareeo
Copy link

@mareeo mareeo commented Apr 24, 2017

The keypress event is deprecated according to the DOM Level 3 Spec. In my testing, newer Android devices running Chrome are no longer triggering the keypress, only keydown and keyup. My fork modifies this library to rely only on keydown. The existing code relied both on the keypress and keydown events to handle special button presses, and with my modification this is no longer necessary.

Also updated are code formatting changes, updating various things to conform to jQuery plugin best practices, and fixing formatting issues in the documentation. The library's API was not affected by any of these changes.

mareeo added 3 commits April 24, 2017 10:26
Updated to v1.2.1
 -The keydown event is now used for input characters instead of keypress
 -Various internal code changes to use jQuery plugin best practices
The 'scannerDetectionReceive' event only fires when a valid character is received (excludes tab, backspace, etc.).
@twf-nikhila
Copy link

@kabachello this looks like a good fix/improvement from @mareeo , you should merge it imo :)

@twf-nikhila
Copy link

@mareeo @kabachello Want to know few things:

  1. Will this also detect non-alphanumeric symbols like hash (#) or dollar ($) etc?
  2. What if a carriage return is disabled in barcode scanner? Will this also detect a barcode if disabled and/or enabled?

@mareeo
Copy link
Author

mareeo commented Jun 25, 2019

Yeah, as long as it is a keycode it recognizes here. A special end key like keycode 13 (enter) isn't required for it to detect a scan, as long as it meets the minLength and avgTimeByChar requirements set.

@Aashik30
Copy link

Aashik30 commented Feb 10, 2021

I do one concept of autoscan ,I want to scan the auto scan in the stage, but in stage there are many input box , So the focus will automatically focus the input box,
So I cant scan the autoscan module,So what can i do for that?
I want to Scan that stage. So i want to block the stage textbox focus in that particular scan time and

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants