Created
April 27, 2009 20:25
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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