From 09a81262cd751c54d76215559fa8b21ca7182638 Mon Sep 17 00:00:00 2001 From: Maarten Sijm <9739541+mpsijm@users.noreply.github.com> Date: Wed, 25 Sep 2024 21:03:56 +0200 Subject: [PATCH] Fix #2701: Do not show shortcut box when modifier key is pressed --- webapp/public/js/domjudge.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webapp/public/js/domjudge.js b/webapp/public/js/domjudge.js index 0e9dde24ef..810883890e 100644 --- a/webapp/public/js/domjudge.js +++ b/webapp/public/js/domjudge.js @@ -834,6 +834,10 @@ function initializeKeyboardShortcuts() { if (keysCookie != 1 && keysCookie != "") { return; } + // Do not trigger shortcuts if user is pressing Ctrl/Alt/Option/Meta key. + if (e.altKey || e.ctrlKey || e.metaKey) { + return; + } // Check if the user is not typing in an input field. if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') { return;