I\'m coding a function in jquery that executes if Ctrl+R is pressed but I can\'t seem to find out what the left and right ctrl keycodes are... Can some
event.key and modern JS!$(document).keypress(function(event) {
if (event.key === "r" && event.ctrlKey) {
// Do something
}
});
or without jQuery:
document.addEventListener("keypress", function onEvent(event) {
if (event.key === "r" && event.ctrlKey) {
// Do something better
}
});
Mozilla Docs
Supported Browsers