Try looking in the event object.
e.g.
document.body.onclick = function (e) {
if (e.ctrlKey) {
alert("ctr key was pressed during the click");
}
}
<p>Click me, and sometimes hold CTRL down!</p>
More Related Contents:
- what is Efficient way to find tr using classname in ie
- Any Javascript GURU here to make this Script ? If Anchor is Changed Redirect the Page
- Repeat a string in JavaScript a number of times
- How to disable HTML links
- Making facebook login work with an Android Webview
- Remove Duplicate objects from JSON Array
- How To Set A JS object property name from a variable
- How to get nth-child selector to skip hidden divs [duplicate]
- Prevent automatic browser scroll on refresh
- Angular app has to clear cache after new deployment
- orderBy array item value in Angular ng-repeat
- javascript surprising array comparison
- JavaScript: sharing data between tabs
- Static image src in Vue.js template
- Check if user has a third party Chrome extension installed
- How to make POST requests with the FormData API
- AngularJS abort all pending $http requests on route change
- Javascript onHover event
- Group by multiple values Underscore.JS but keep the keys and values
- Update Array in React
- asp.net ScriptManager PageMethods is undefined
- JavaScript: How do I print a message to the error console?
- How to know if window “load” event was fired already
- How do you completely remove Ionic and Cordova installation from mac?
- Convert non-ASCII characters (umlauts, accents…) to their closest ASCII equivalent (for slug creation)
- How to hide optgroup/option elements?
- When to access the attribute (vs the property)?
- Determine distance from the top of a ‘div’ to top of the window with JavaScript
- Passing object from injected page script to content script
- How to pass some parameters to function called in addEventListener? [duplicate]