Skip to content

Commit

Permalink
Convertir a md web/api/keyboardevent/metakey [es] (#9307)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanVqz committed Oct 17, 2022
1 parent ed39dbc commit 42a5b63
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 85 deletions.
85 changes: 0 additions & 85 deletions files/es/web/api/keyboardevent/metakey/index.html

This file was deleted.

68 changes: 68 additions & 0 deletions files/es/web/api/keyboardevent/metakey/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: KeyboardEvent.metaKey
slug: Web/API/KeyboardEvent/metaKey
translation_of: Web/API/KeyboardEvent/metaKey
browser-compat: api.KeyboardEvent.metaKey
---

{{APIRef("DOM Events")}}

La propiedad **`KeyboardEvent.metaKey`** es de solo lectura y regresa un valor {{jsxref("Boolean")}} que indica si la tecla <kbd>Meta</kbd> estaba presionada (true) o no (false) cuando el evento ocurrio.

> **Nota:** En teclados Macintosh es la tecla comando (<kbd>⌘</kbd>). En teclados Windows la tecla es lla tecla window (<kbd>⊞</kbd>).
## Syntax

```
var metaKeyPressed = instanceOfKeyboardEvent.metaKey
```

### Valor de retorno

{{jsxref("Boolean")}}

## Ejemplo

```js
function goInput(e) {
// Revisa si estaba presionada la tecla meta y
if (e.metaKey) {
// realiza esto en caso de cierto
superSizeOutput(e);
} else {
//Realiz esto en caso de falso
doOutput(e);
}
}
```

## metaKey

### Contenido HTML

```html
<div id="example" onmousedown="ismetaKey(event);">¡Presiona la tecla meta y dame click!<div>
```

### Contenido Javascript

```js
function ismetaKey(e){
var el=document.getElementById("example");//Toma el control del div example
var mK=e.metaKey;//Obtiene el valor de metaKey y lo almacena
el.innerHTML="¡Presiona la tecla meta y dame click!</br>metaKey:"+mK;//Muestra el valor de metaKey
}
```
{{ EmbedLiveSample('metaKey') }}

## Especificaciones

{{Specifications}}

## Compatibilidad de Navegadores

{{Compat}}

## Véase también

- {{ domxref("KeyboardEvent") }}

0 comments on commit 42a5b63

Please sign in to comment.