CopyCodeThe Code is as follows: function test ()
{
Alert (event. x + "" + event. y );
Alert (event. Button );
}
/* The right-click menu is not displayed */
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 horizontal mouse axis
Event. y vertical axis of the mouse
Event. keycode keyboard Value
Events. Button = 0 by default. No buttons are pressed.
Events. Button = 1 left mouse button
Events. Button = 2 right-click
Events. Button = 3 press the mouse key at the same time
Events. Button = 4 middle mouse buttons
Events. Button = 5 press both the left mouse button and the middle mouse button
Events. Button = 6 Right-click and press
Events. Button = 7 all three keys are pressed