Copy Code code as follows:
function test ()
{
Alert (event.x+ "" +event.y);
alert (Event.button);
}
/* Right button menu does not show * *
Document.oncontextmenu=function ()
{
return false;
}
/*document.onmousedown=function ()
{
if (event.button==1)
{Alert ("left")}
if (event.button==2)
{alert (' right ')}
}*/
Document.onkeydown=function ()
{
alert (Event.keycode);
}
</script>
Event.x Mouse Axis
Event.y Mouse longitudinal axis
Event.keycode Keyboard Value
Events.button==0 default. No buttons were pressed.
Events.button==1 left mouse button
events.button==2 right mouse button
Events.button==3 the right mouse button and press
Events.button==4 The middle mouse button
Events.button==5 the left mouse button and the middle key pressed at the same time
Events.button==6 the right mouse button and the middle key at the same time
Events.button==7 all three keys are pressed