Is Shift key pressed during the mouse click : Mouse Event « Event « JavaScript Tutorial

JavaScript Tutorial
1. Language Basics
2. Operators
3. Statement
4. Development
5. Number Data Type
6. String
7. Function
8. Global
9. Math
10. Form
11. Array
12. Date
13. Dialogs
14. Document
15. Event
16. Location
17. Navigator
18. Screen
19. Window
20. History
21. HTML Tags
22. Style
23. DOM Node
24. Drag Drop
25. Object Oriented
26. Regular Expressions
27. XML
28. GUI Components
29. Dojo toolkit
30. jQuery
31. Animation
32. MS JScript
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript Tutorial » Event » Mouse Event 
15. 8. 2. Is Shift key pressed during the mouse click
<html>
<head>
<title>Mouse Events Example</title>
<script type="text/javascript">
    function handleEvent(oEvent) {
        var oTextbox = document.getElementById("txt1");
        oTextbox.value += "\n    button down is " + oEvent.button;

        var arrKeys = [];
        if (oEvent.shiftKey) {
            arrKeys.push("Shift");
        }
        oTextbox.value += "\n    keys down are " + arrKeys;
    }
</script>
</head>
<body>
<P>Use your mouse to click and double click the red square.</p>
<div style="width: 100px; height: 100px; background-color: red"
     onclick="handleEvent(event)"
     id="div1"></div>
<P><textarea id="txt1" rows="15" cols="50"></textarea></p>
</body>
</html>
15. 8. Mouse Event
15. 8. 1. Get mouse clicked button
15. 8. 2. Is Shift key pressed during the mouse click
15. 8. 3. Is alt key pressed during the mouse click
15. 8. 4. Is control key pressed during the mouse click
15. 8. 5. Mouse event target element name
15. 8. 6. Mouse event from and to elements (IE)
15. 8. 7. Mouse event related element (Firefox)
15. 8. 8. onmouseover event handler
15. 8. 9. onmouseout event handler
15. 8. 10. onmousedown event handler
15. 8. 11. onmouseup event handler
15. 8. 12. onclick mouse event handler
15. 8. 13. ondblclick mouse event handler
15. 8. 14. Display current mouse position in status bar (IE)
15. 8. 15. Use mouse in/out action to trigger the style change
15. 8. 16. Get mouse client X and Y
15. 8. 17. Get mouse screen X and Y
15. 8. 18. Set element's pixelTop and pixelLeft to current mouse event (IE)
15. 8. 19. Get X/Y screen position (IE)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.