| |||||||||||||||||||||
shiftKey PropertyDOM Level 2 Specification. Retrieves the state of the SHIFT key. Syntax
Possible Values
The property is read-only with no default value. RemarksThis property is used to indicate whether the SHIFT key was depressed during the firing of the event. ExampleThis example tracks whether the Alt, Ctrl, or Shift key returns Here's the code for that exercise: <script language="JavaScript">
<!--
function chkKey ( ) {
var ctrlKey = document.layers ? event.modifiers &
Event.CONTROL_MASK : event.ctrlKey;
var altKey = document.layers ? event.modifiers &
Event.ALT_MASK : event.altKey;
var shiftKey = document.layers ? event.modifiers &
Event.SHIFT_MASK : event.shiftKey;
alert ( 'Ctrl ' + ctrlKey + ' \nAlt ' +
altKey + ' \nShift " + shiftKey );
}
//-->
</script>
Applies ToSee AlsoaltKey, ctrlKey, Key Capture Routines |
| ||||||||||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme