Skip to content

Instantly share code, notes, and snippets.

@TravelingMan
Created May 12, 2015 02:27
Show Gist options
  • Save TravelingMan/83f8bb87c06d4a5fde82 to your computer and use it in GitHub Desktop.
Save TravelingMan/83f8bb87c06d4a5fde82 to your computer and use it in GitHub Desktop.
Mouse events, key event
document.addEventListener('keyup', function (event) {
var key = event.keyCode;
var letter = String.fromCharCode(key);
});
document.addEventListener('mousemove', function (event) {
console.log("mouse move x:", event.clientX, "y:", event.clientY);
});
document.addEventListener('mousedown', function (event) {
console.log("mouse downt at x:", event.clientX, "y:", event.clientY);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment