Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
This example shows how to retrieve information from the shiftKeyIHTMLEventObj2::shiftKey property of the event object. When the user simultaneously presses the shift key and types a character in the first text field, the value "true" appears in the second text field.
<HEAD>
<SCRIPT>
function checkKey()
{
if (window.event.shiftKey) // checks whether the SHIFT key
// is pressed
{
txtOutput.value = "true"; // returns TRUE if SHIFT is pressed
// when the event fires
}
}
</SCRIPT>
</HEAD>
<BODY>
<P>Press the SHIFT key while pressing another key.<BR>
<INPUT TYPE=text NAME=txtEnterValue onkeypress="checkKey()">
<P>Indicates "true" if the shift key is used.<BR>
<INPUT TYPE=text NAME=txtOutput>
</BODY>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.