Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cmarshall/102703 to your computer and use it in GitHub Desktop.
Save cmarshall/102703 to your computer and use it in GitHub Desktop.
Detects if Ctrl, Alt or Shit is pressed when click event is triggered
$(document).click(function(e) {
if(e.ctrlKey) {
console.log("Ctrl+Click");
// your code goes here...
} else if(e.altKey) {
console.log("Alt+Click");
} else if(e.shiftKey) {
console.log("Shift+Click");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment