I am trying to capture the Command+1 hotkey on a mac using Safari. As of now my code works in firefox, but Safari still loads the bookmark associated with that number. I have read that Safari doesn’t let you capture DOM objects, but I’m not sure where to go from here. Right now I am using
$(document)
.bind('keypress', 'Command+1', function(){
//load popup
alert("Hello World.");
})
Something like the following should help you get the right direction:
in firefox on a mac the command key sends a different key code instead of sending a double key trigger. So the lowercase letter x = 88, and lowercase x holding command = 224. So you may just have to apply some math to figure out if the command key was held.