From 3ac5eb350c4df7e82ef72e9316af2fa32a4d59c5 Mon Sep 17 00:00:00 2001 From: Stian Date: Mon, 1 Sep 2025 11:18:23 +0200 Subject: [PATCH] Possible fix for errors thrown in console --- js/spatial-navigation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/spatial-navigation.js b/js/spatial-navigation.js index 6a336c7..976c256 100644 --- a/js/spatial-navigation.js +++ b/js/spatial-navigation.js @@ -1838,7 +1838,7 @@ function startListeners() { exports.startListeners = startListeners; function removeFromKeysDown(e) { - KEYS_DOWN.delete(e.key.toLowerCase()); + if (e.key) KEYS_DOWN.delete(e.key.toLowerCase()); } function addToKeysDown(e) { @@ -1846,7 +1846,7 @@ function addToKeysDown(e) { if (e.ctrlKey) KEYS_DOWN.add("control"); if (e.altKey) KEYS_DOWN.add("alt"); if (e.shiftKey) KEYS_DOWN.add("shift"); - KEYS_DOWN.add(e.key.toLowerCase()); + if (e.key) KEYS_DOWN.add(e.key.toLowerCase()); } exports.addToKeysDown = addToKeysDown;