From 5487191dfddde852644d5d25c073b674b7a6a8a7 Mon Sep 17 00:00:00 2001 From: Jakub Niewiadomski Date: Tue, 23 Nov 2021 11:50:29 +0100 Subject: [PATCH] Add JSON used characters --- onscan.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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; }