From 70614928af20e54825793b29e61c4ef102de47be Mon Sep 17 00:00:00 2001 From: ortiza5 <43008712+ortiza5@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:56:38 -0700 Subject: [PATCH] callback is the trigger function, so it needs a controlKey arg TODO: Need to find a way to detect if CTRL is pressed. Looking at the event, there didn't seem to be a parameter. --- js/spatial-navigation.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/spatial-navigation.js b/js/spatial-navigation.js index 647e129..c2fb3b0 100644 --- a/js/spatial-navigation.js +++ b/js/spatial-navigation.js @@ -2521,12 +2521,13 @@ function map(targets, callback, reverse, stack) { function handler(event) { event.preventDefault(); event.stopImmediatePropagation(); - var key = ja2en(event.target.value), shiftKey = key === key.toUpperCase(), target = table[key.toLowerCase()]; + // TODO: find way to detect Ctrl key + var key = ja2en(event.target.value), shiftKey = key === key.toUpperCase(), target = table[key.toLowerCase()], controlKey = false; observer.removeEventListener('keydown', handler); observer.removeEventListener('blur', handler); container.remove(); if (key && target) { - callback(target, shiftKey); + callback(target, shiftKey, controlKey); } observer.blur(); observer.remove();