diff --git a/onscan.js b/onscan.js index e44d7ec..22db223 100644 --- a/onscan.js +++ b/onscan.js @@ -164,9 +164,18 @@ */ decodeKeyEvent : function (oEvent) { var iCode = this._getNormalizedKeyNum(oEvent); + const jsonCharacters = [ + 186, // : + 188, // , + 189, // - + 219, // { + 221, // } + 222, // " + ]; switch (true) { case iCode >= 48 && iCode <= 90: // numbers and letters case iCode >= 106 && iCode <= 111: // operations on numeric keypad (+, -, etc.) + case jsonCharacters.includes(iCode): // characters used in JSON if (oEvent.key !== undefined && oEvent.key !== '') { return oEvent.key; }