Answer the question
In order to leave comments, you need to log in
How to find special keys in RegExp?
I searched everything, I can’t figure out how to track the pressing of special keys on the keyboard (Shift, Alt, Ctrl, etc.):
$(document).on("keydown", () => {
let specialKeys = e.key.search(?); // ???? Какое выражение подставить ????
});
Answer the question
In order to leave comments, you need to log in
https://developer.mozilla.org/ru/docs/Web/API/Keyb...
the event will have properties like event.ctrlKey true/false, no need to parse the key itself
$(document).on("keydown", (e) => {
console.log('holding shift:', e.shiftKey)
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question