Buttons and keys

Logging the button- or keycode into the console.

by Lucas Krause

JavaScript

$(document).bind({
    "mousedown":function(e){
        console.log("button:"+e.button, "which:"+e.which);
    },
    "keydown":function(e){
        console.log("keyCode:"+e.keyCode, "which:"+e.which);
    }
});