El evento de MouseEvent.shiftKey
es una propiedad de solo lectura que indica si la tecla de shift se presion贸 (true
) o no (false
).
Sintaxis
var shiftKeyPressed = instanceOfMouseEvent.shiftKey
Valor que retorna
Un valor booleano
Ejemplo
<html>
<head>
<title>Ejemplo de shiftKey</title>
<script type="text/javascript">
function showChar(e){
alert(
"Tecla presionada: " + String.fromCharCode(e.charCode) + "\n"
+ "charCode: " + e.charCode + "\n"
+ "SHIFT presionada: " + e.shiftKey + "\n"
+ "ALT presionado: " + e.altKey + "\n"
);
}
</script>
</head>
<body onkeypress="showChar(event);">
<p>Presione cualquier tecla, con o sin la tecla SHIFT.<br />
Tambi茅n puede utilizar SHIFT junto a la tecla ALT.</p>
</body>
</html>
Especificaci贸n
Especificaci贸n | Estado | Comentario |
---|---|---|
Document Object Model (DOM) Level 3 Events Specification La definici贸n de 'MouseEvent.shiftKey' en esta especificaci贸n. |
Obsolete | Sin cambios desde Document Object Model (DOM) Level 2 Events Specification. |
Document Object Model (DOM) Level 2 Events Specification La definici贸n de 'MouseEvent.shiftKey' en esta especificaci贸n. |
Obsolete | Primera definici贸n. |
Compatibilidad con navegadores
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Caracter铆stica | Edge | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Soporte B谩sico | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Caracter铆stica | Edge | Firefox Mobile (Gecko) | Android | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Soporte B谩sico | (Yes) | ? | ? | ? | ? | ? |