I\'m trying to process input from a barcode scanner in a javascript browser app. The scanner output is a string of characters, which also contains at least one Group Separator c
Firefox doesn't transmit ALT keypress, but only keydown and keyup events.
This work for me in each browser:
//GS1 Datamatrix in Firefox, Chrome & IE
var altValue = '';
document.getElementById('SKAN').addEventListener('keydown', function(e) {
if(e.altKey){
if(e.which != 18){
altValue += e.which
}
if(altValue === '969698105'){
this.value += String.fromCharCode(29);
}
}
});
document.getElementById('SKAN').addEventListener('keyup', function(e) {
if(e.altKey === false){
altValue = '';
}
});