Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convertir a md web/api/keyboardevent/metakey [es] #9307

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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") }}