JavaScript MouseEvent shiftKey Property Last Updated : 08 Feb, 2023 Comments Improve Suggest changes Like Article Like Report The mouseEvent shiftKey property is used to define whether the shift key is pressed or not. It is a boolean value. When the shift key is pressed then on click of the mouse left button, it returns true and if the shift key is not pressed then it returns false. Syntax: event.shiftKey Return Value: It returns a boolean value indicating whether the shift key is pressed or not. true: it indicates the shift key is pressed.false: it indicates the shift key is not pressed. Example: In this example, we will see the example of MouseEvent shiftKey property. html <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h2> mouseEvent shiftKey Property </h2> <button onclick="geek (event);">Get Shift key state!</button> <p id="gfg"></p> <script> function geek (event) { if (event.shiftKey) { document.getElementById("gfg").innerHTML= "Shift key is pressed."; } else { document.getElementById("gfg").innerHTML= "Shift key is not pressed."; } } </script> </body> Output: JavaScript MouseEvent shiftKey Property Supported Browsers: The browser supported by shiftKey properties are listed below: Apple SafariGoogle ChromeFirefoxOperaInternet Explorer Comment More infoAdvertise with us Next Article HTML | DOM KeyboardEvent shiftKey Property V Vishal Chaudhary 2 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Properties Similar Reads Javascript MouseEvent which Property The mouse event which property is used to return a number that corresponds to the pressed mouse button when a mouse event is triggered Syntax: event.which Return value: It returns a number indicating which mouse button is pressed: For left mouse button: 1 is returnedFor middle mouse button: 2 is ret 1 min read JavaScript MouseEvent Button Property The MouseEvent button property is used to define the left or right-click events. When the mouse button is clicked then it returns an integer value which describes the left, right, or middle mouse button. Syntax: event.button Return Value: This event returns an integer value on mouse click events are 2 min read JavaScript MouseEvent altKey Property The mouseEvent altKey property is used to define whether the alt key is pressed or not. It is a boolean value. When the alt key is pressed then on click of the mouse buttons it returns true and if it is not pressed then it returns false. Syntax: event.altKey Return Value: It returns a boolean value 1 min read JavaScript MouseEvent ctrlKey Property The mouseEvent ctrlKey property is used to define whether the ctrl key is pressed or not. It is a boolean value. When the ctrl key is pressed then on click of the mouse buttons it returns true and if it is not pressed then it returns false. Syntax: event.ctrlKey Return Value: It returns a boolean va 1 min read HTML | DOM KeyboardEvent shiftKey Property The KeyboardEvent shiftKey property in HTML DOM is a read-only property and used to return a Boolean value which indicates the SHIFT key is pressed or not. The KeyboardEvent shiftKey property returns true if the SHIFT key is pressed, otherwise returns false. Syntax: event.shiftKey Below program illu 1 min read HTML DOM MouseEvent clientX Property The mouse event clientX property returns the horizontal coordinate (X-axis) of the mouse pointer in relation to the viewport when a mouse event occurs. It captures the mouse's position without considering any scroll offset.Syntax:event.clientXReturn Value: clientX returns the mouse pointer's X-coord 1 min read Like