Esempio
Scopri se il "SHIFT" tasto è stato premuto quando un pulsante del mouse viene premuto:
if (event.shiftKey) {
alert("The SHIFT key was pressed!");
} else {
alert("The SHIFT key was NOT pressed!");
}
Prova tu stesso " Definizione e l'utilizzo
La proprietà shiftKey restituisce un valore booleano che indica se il "SHIFT" tasto è stato premuto quando un evento del mouse è stato attivato.
Nota: questa proprietà è di sola lettura.
Supporto browser
Proprietà | |||||
---|---|---|---|---|---|
shiftKey | sì | sì | sì | sì | sì |
Sintassi
event .shiftKey
Dettagli tecnici
Valore di ritorno: | Un valore booleano, che indica se il "SHIFT" tasto è stato premuto quando l'evento del mouse si è verificato. Valori possibili:
|
---|---|
DOM Versione: | Livello DOM 2 Eventi |
Pagine correlate
Di riferimento HTML DOM: MouseEvent altKey Property
Di riferimento HTML DOM: MouseEvent ctrlKey Property
Di riferimento HTML DOM: MouseEvent metaKey Property
<Oggetto evento