Skip to content

Instantly share code, notes, and snippets.

@caubry
Last active January 3, 2016 17:19
Show Gist options
  • Save caubry/8494857 to your computer and use it in GitHub Desktop.
Save caubry/8494857 to your computer and use it in GitHub Desktop.
function setup() {
var canvas = document.getElementById('my_canvas');
canvas.addEventListener('mousemove', onMouseMove);
canvas.addEventListener('keydown', onKeyDown);
}
function onMouseMove(event) {
var posX = event.clientX;
var posY = event.clientY;
return posX;
}
function onKeyDown(event) {
var keyID = event.keyID;
return keyID;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment