pressed HW button only once then the event is running infinite time (not every time facing issue)

c chetan patel 10 months 2 weeks ago
92 1 0
Hello Team
I am a cordova application developer.
 I have purchased a Zebra TC27 PDA for my cordova application for 2D scanner functionality.
 
I used it in my app for keydown events using EventListener
please see below example.
 
document.addEventListener("keydown", onButtonPress, false);
function onButtonPress(e) {
  alert("key : " + e.key + "\ncode : " + e.code);
}
 
Problem is
I pressed button only once then the event is running infinite time (not every time facing issue)
 
should be event call only one time
 
Please suggest or a demo/ example if possible.
Please Register or Login to post a reply

1 Replies

B Bruce Workman

This issue could be related to the device's keyboard behavior or the way events are being handled in your Cordova application. Instead of relying on e.key or e.code, you might want to use e.keyCode to identify the specific key being pressed. Some devices may have variations in how they report key spacebar clicker events.

CONTACT
Can’t find what you’re looking for?