Esempio
Scopri se il "META" tasto è stato premuto quando un pulsante del mouse viene premuto:
if (event.metaKey) {
alert("The META key was pressed!");
} else {
alert("The META key was NOT pressed!");
}
Prova tu stesso " Definizione e l'utilizzo
La proprietà metakey restituisce un valore booleano che indica se il "META" tasto è stato premuto quando un evento del mouse è stato attivato.
Non tutte le tastiere hanno il tasto Meta. E 'comune per Sun tastiere microsistemi, e il MIT e tastiere delle macchine LISP. Il tasto Meta è o etichettato "META" o contrassegnato con un diamante solido "◆" simbolo.
Alle tastiere Mac, il tasto Meta è rappresentato dal il "Command/Cmd" ("⌘") chiave.
Nota: questa proprietà è di sola lettura.
Supporto browser
Proprietà | |||||
---|---|---|---|---|---|
metaKey | sì | sì | sì | sì | sì |
Sintassi
event .metaKey
Dettagli tecnici
Valore di ritorno: | Un valore booleano, che indica se il "META" 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 shiftKey Property
<Oggetto evento