Is the shift key being pressed down?
var x = event.getModifierState("Shift");
<!DOCTYPE html> <html> <body> <input type="text" size="40" onmousedown="myFunction(event)"> <p id="demo"></p> <script> function myFunction(event) {/*www .j a v a 2 s .c om*/ var x = event.getModifierState("Shift"); document.getElementById("demo").innerHTML = "Pressing the shift key: " + x; } </script> </body> </html>