From b2d920485f23a645d1ebc8ddefe450c7de93056c Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Fri, 14 Aug 2020 18:06:40 -0500 Subject: [PATCH] Fix non-letter keys --- src/io/keyboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/keyboard.js b/src/io/keyboard.js index 3e0fbb63..51729eb6 100644 --- a/src/io/keyboard.js +++ b/src/io/keyboard.js @@ -138,9 +138,9 @@ class Keyboard { */ postData (data) { if (!data.key) return; - // tw: convert key to uppercase because of changes in _keyStringToScratchKey + // tw: convert single letter keys to uppercase because of changes in _keyStringToScratchKey const scratchKeyCased = this._keyStringToScratchKey(data.key); - const scratchKey = scratchKeyCased.toUpperCase(); + const scratchKey = scratchKeyCased.length === 1 ? scratchKeyCased.toUpperCase() : scratchKeyCased; if (scratchKey === '') return; const index = this._keysPressed.indexOf(scratchKey); if (data.isDown) {