I'm using the following code to catch when people press Ctrl+Shift+P for my chrome extension:
window.addEventListener("keydown", function(event) {
var modifier = event.ctrlKey || event.metaKey;
if (modifier && event.shiftKey && event.keyCode == 80) {
//code goes here
}
});
I'm hoping the var modifier = event.ctrlKey || event.metaKey;
line means it will catch when Mac users press Cmd-Shift-P but have no Mac computer to test this on. Is it so? Will my hotkey work for Mac users?
Also, what is the keyCode for when the Cmd key goes down and up? Is it 17, the same as for Ctrl?