<p id="log">The ctrl key was pressed while the cursor was moving: false</p>MouseEvent: ctrlKey property / notebook
MouseEvent: ctrlKey property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const log = document.querySelector("#log");
window.addEventListener("mousemove", logKey);
function logKey(e) {
log.textContent = `The ctrl key was pressed while the cursor was moving: ${e.ctrlKey}`;
}