Fix non-letter keys

This commit is contained in:
Thomas Weber committed 2020-08-14 18:06:40 -05:00
1 parent 6083f4dcd7
commit b2d920485f
1 file changed
+2 -2
+2 -2
View File
@@ -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) {