aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/keyboardevent
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
commit1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch)
tree0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/api/keyboardevent
parent4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff)
downloadtranslated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip
initial commit
Diffstat (limited to 'files/es/web/api/keyboardevent')
-rw-r--r--files/es/web/api/keyboardevent/getmodifierstate/index.html253
-rw-r--r--files/es/web/api/keyboardevent/index.html441
-rw-r--r--files/es/web/api/keyboardevent/key/index.html212
-rw-r--r--files/es/web/api/keyboardevent/metakey/index.html131
-rw-r--r--files/es/web/api/keyboardevent/which/index.html62
5 files changed, 1099 insertions, 0 deletions
diff --git a/files/es/web/api/keyboardevent/getmodifierstate/index.html b/files/es/web/api/keyboardevent/getmodifierstate/index.html
new file mode 100644
index 0000000000..b44ecc6da3
--- /dev/null
+++ b/files/es/web/api/keyboardevent/getmodifierstate/index.html
@@ -0,0 +1,253 @@
+---
+title: KeyboardEvent.getModifierState()
+slug: Web/API/KeyboardEvent/getModifierState
+tags:
+ - API
+ - DOM
+ - KeyboardEvent
+ - Referencia
+ - getModifierState
+ - metodo
+translation_of: Web/API/KeyboardEvent/getModifierState
+---
+<p>{{APIRef("DOM Events")}}</p>
+
+<p>El método <code><strong>KeyboardEvent.getModifierState()</strong></code> retorna <code>true</code> respecto al estado actual de la tecla modificadora especificada si la misma está presionada o bloqueada, en caso contrario devuelve <code>false</code>.</p>
+
+<h2 id="Sintaxis">Sintaxis</h2>
+
+<pre class="syntaxbox">var <code><em>active</em> = <em>event</em>.getModifierState(<em>keyArg</em>);</code></pre>
+
+<h3 id="Retorna">Retorna</h3>
+
+<p>A {{jsxref("Boolean")}}</p>
+
+<h3 id="Parámetros">Parámetros</h3>
+
+<dl>
+ <dt><em><code>keyArg</code></em></dt>
+ <dd>El valor de la tecla modificadora. El valor debe ser uno de los valores {{domxref("KeyboardEvent.key")}} que representan las teclas modificadoras, o el string <code>"Accel"</code> {{deprecated_inline}}, el cual es case-sensitive.</dd>
+</dl>
+
+<h2 id="Teclas_modificadoras_en_Internet_Explorer">Teclas modificadoras en Internet Explorer</h2>
+
+<p>IE9 usa <code>"Scroll"</code> para <code>"ScrollLock"</code> y <code>"Win"</code> para <code>"OS"</code>.</p>
+
+<h2 id="Teclas_modificadoras_en_Gecko">Teclas modificadoras en Gecko</h2>
+
+<table style="width: 100%;">
+ <caption>When getModifierState() returns true on Gecko?</caption>
+ <thead>
+ <tr>
+ <th scope="row"> </th>
+ <th scope="col">Windows</th>
+ <th scope="col">Linux (GTK)</th>
+ <th scope="col">Mac</th>
+ <th scope="col">Android 2.3</th>
+ <th scope="col">Android 3.0 or latter</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row"><code>"Alt"</code></th>
+ <td>Either <kbd>Alt</kbd> key or <kbd>AltGr</kbd> key pressed</td>
+ <td><kbd>Alt</kbd> key pressed</td>
+ <td><kbd>⌥ Option</kbd> key pressed</td>
+ <td colspan="2" rowspan="1"><kbd>Alt</kbd> key or <kbd>option</kbd> key pressed</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"AltGraph"</code></th>
+ <td>
+ <p>Both <kbd>Alt</kbd> and <kbd>Ctrl</kbd> keys are pressed, or <kbd>AltGr</kbd> key is pressed</p>
+ </td>
+ <td><kbd>Level 3 Shift</kbd> key (or <kbd>Level 5 Shift</kbd> key {{gecko_minversion_inline("20.0")}}) pressed</td>
+ <td><kbd>⌥ Option</kbd> key pressed</td>
+ <td colspan="2" rowspan="1" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"CapsLock"</code></th>
+ <td colspan="3" style="text-align: center;">During LED for <kbd>⇪ Caps Lock</kbd> turned on</td>
+ <td style="text-align: center; background-color: rgb(204, 204, 204);"><em>Not supported</em></td>
+ <td>While <kbd>CapsLock</kbd> is locked {{gecko_minversion_inline("29.0")}}</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"Control"</code></th>
+ <td>Either <kbd>Ctrl</kbd> key or <kbd>AltGr</kbd> key pressed</td>
+ <td><kbd>Ctrl</kbd> key pressed</td>
+ <td><kbd>control</kbd> key pressed</td>
+ <td><kbd>menu</kbd> key pressed.</td>
+ <td><kbd>Ctrl</kbd> key, <kbd>control</kbd> key or <kbd>menu</kbd> key pressed.</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"Fn"</code></th>
+ <td colspan="4" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ <td><kbd>Function</kbd> key is pressed, but we're not sure what key makes the modifier state active. <kbd>Fn</kbd> key on Mac keyboard doesn't cause this active. {{gecko_minversion_inline("29.0")}}</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"FnLock"</code></th>
+ <td colspan="5" rowspan="1" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"Hyper"</code></th>
+ <td colspan="5" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"Meta"</code></th>
+ <td style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ <td style="text-align: center;"><kbd>Meta</kbd> key pressed {{gecko_minversion_inline("17.0")}}</td>
+ <td><kbd>⌘ Command</kbd> key pressed</td>
+ <td style="text-align: center; background-color: rgb(204, 204, 204);"><em>Not supported</em></td>
+ <td><kbd>⊞ Windows Logo</kbd> key or <kbd>command</kbd> key pressed</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"NumLock"</code></th>
+ <td colspan="2" style="text-align: center;">During LED for <kbd>Num Lock</kbd> turned on</td>
+ <td>A key on numpad pressed</td>
+ <td style="text-align: center; background-color: rgb(204, 204, 204);"><em>Not supported</em></td>
+ <td>While <kbd>NumLock</kbd> is locked {{gecko_minversion_inline("29.0")}}</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"OS"</code></th>
+ <td><kbd>⊞ Windows Logo</kbd> key pressed</td>
+ <td><kbd>Super</kbd> key or <kbd>Hyper</kbd> key pressed (typically, mapped to <kbd>⊞ Windows Logo</kbd> key)</td>
+ <td colspan="3" rowspan="1" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"ScrollLock"</code></th>
+ <td>During LED for <kbd>Scroll Lock</kbd> turned on</td>
+ <td>During LED for <kbd>Scroll Lock</kbd> turned on, but typically this isn't supported by platform</td>
+ <td colspan="2" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ <td>While <kbd>ScrollLock</kbd> is locked {{gecko_minversion_inline("29.0")}}</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"Shift"</code></th>
+ <td colspan="5" rowspan="1" style="text-align: center;"><kbd>⇧ Shift</kbd> key pressed</td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"Super"</code></th>
+ <td colspan="5" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"Symbol"</code></th>
+ <td colspan="5" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ </tr>
+ <tr>
+ <th scope="row"><code>"SymbolLock"</code></th>
+ <td colspan="5" style="background-color: rgb(204, 204, 204); text-align: center;"><em>Not supported</em></td>
+ </tr>
+ </tbody>
+</table>
+
+<ul>
+ <li>On the other platforms, "Alt", "Control" and "Shift" may be supported.</li>
+ <li>All modifiers (except <code>"FnLock"</code>, <code>"Hyper"</code>, <code>"Super"</code> and <code>"Symbol"</code> which are defined after Gecko implements this) are always supported for untrusted events on Gecko. This doesn't depend on the platform.</li>
+</ul>
+
+<h2 id="El_modificador_virtual_Accel"> El modificador virtual <code>"Accel"</code></h2>
+
+<div class="note"><strong>Note:</strong> The <code>"Accel"</code> virtual modifier has been effectively <strong>deprecated</strong> in current drafts of the DOM3 Events specification.</div>
+
+<p><code>getModifierState()</code> also accepts a deprecated virtual modifier named <code>"Accel"</code>. <code>event.getModifierState("Accel")</code> returns <code>true</code> when at least one of {{domxref("KeyboardEvent.ctrlKey")}} or {{domxref("KeyboardEvent.metaKey")}} is <code>true</code>.</p>
+
+<p>In old implementations and outdated specifications, it returned <code>true</code> when a modifier which is the typical modifier key for the shortcut key is pressed. For example, on Windows, pressing <kbd>Ctrl</kbd> key may make it return <code>true</code>. However, on Mac, pressing <kbd>⌘ Command</kbd> key may make it return <code>true</code>. Note that which modifier key makes it return true depends on platforms, browsers, and user settings. For example, Firefox users can customize this with a pref, <code>"ui.key.accelKey"</code>.</p>
+
+<h2 id="Ejemplo">Ejemplo</h2>
+
+<pre class="brush: js">// Ignore if following modifier is active.
+if (event.getModifierState("Fn") ||
+ event.getModifierState("Hyper") ||
+ event.getModifierState("OS") ||
+ event.getModifierState("Super") ||
+ event.getModifierState("Win") /* hack for IE */) {
+ return;
+}
+
+// Also ignore if two or more modifiers except Shift are active.
+if (event.getModifierState("Control") +
+ event.getModifierState("Alt") +
+ event.getModifierState("Meta") &gt; 1) {
+ return;
+}
+
+// Handle shortcut key with standard modifier
+if (event.getModifierState("Accel")) {
+ switch (event.key.toLowerCase()) {
+ case "c":
+ if (event.getModifierState("Shift")) {
+ // Handle Accel + Shift + C
+ event.preventDefault(); // consume the key event
+ }
+ break;
+ case "k":
+ if (!event.getModifierState("Shift")) {
+ // Handle Accel + K
+ event.preventDefault(); // consume the key event
+ }
+ break;
+ }
+ return;
+}
+
+// Do somethig different for arrow keys if ScrollLock is locked.
+if ((event.getModifierState("ScrollLock") ||
+ event.getModifierState("Scroll") /* hack for IE */) &amp;&amp;
+ !event.getModifierState("Control") &amp;&amp;
+ !event.getModifierState("Alt") &amp;&amp;
+ !event.getModifierState("Meta")) {
+ switch (event.key) {
+ case "ArrowDown":
+ case "Down": // hack for IE and old Gecko
+ event.preventDefault(); // consume the key event
+ break;
+ case "ArrowLeft":
+ case "Left": // hack for IE and old Gecko
+ // Do something different if ScrollLock is locked.
+ event.preventDefault(); // consume the key event
+ break;
+ case "ArrowRight":
+ case "Right": // hack for IE and old Gecko
+ // Do something different if ScrollLock is locked.
+ event.preventDefault(); // consume the key event
+ break;
+ case "ArrowUp":
+ case "Up": // hack for IE and old Gecko
+ // Do something different if ScrollLock is locked.
+ event.preventDefault(); // consume the key event
+ break;
+ }
+}
+</pre>
+
+<div class="note">
+<p>Although, this example uses<code> .getModifierState()</code> with <code>"Alt"</code>, <code>"Control"</code>, <code>"Meta"</code> and <code>"Shift"</code>, perhaps it's better for you to use <code>altKey</code>, <code>ctrlKey</code>, <code>metaKey</code> and <code>shiftKey</code> because they are shorter and may be faster.</p>
+</div>
+
+<h2 id="Especificaciones">Especificaciones</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificaciones</th>
+ <th scope="col">Estado</th>
+ <th scope="col">Comentario</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM3 Events', '#widl-KeyboardEvent-getModifierState', 'getModifierState()')}}</td>
+ <td>{{Spec2('DOM3 Events')}}</td>
+ <td>Initial definition (<a href="https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3Events-key.html#keys-modifier">Modifier Keys spec</a>)</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidad_con_Browsers">Compatibilidad con Browsers</h2>
+
+
+
+<p>{{Compat("api.KeyboardEvent.getModifierState")}}</p>
+
+<h2 id="Ver_también">Ver también</h2>
+
+<ul>
+ <li>The {{domxref("KeyboardEvent")}} this method belongs to.</li>
+ <li>{{domxref("MouseEvent.getModifierState")}}</li>
+</ul>
diff --git a/files/es/web/api/keyboardevent/index.html b/files/es/web/api/keyboardevent/index.html
new file mode 100644
index 0000000000..bcb27d00b6
--- /dev/null
+++ b/files/es/web/api/keyboardevent/index.html
@@ -0,0 +1,441 @@
+---
+title: KeyboardEvent
+slug: Web/API/KeyboardEvent
+tags:
+ - API
+translation_of: Web/API/KeyboardEvent
+---
+<p>{{APIRef("DOM Events")}}</p>
+
+<p>Los objetos <strong><code>KeyboardEvent</code></strong> describen una interacción del usuario con el teclado. Cada evento describe una tecla; el tipo de evento(<code>keydown</code>, <code>keypress</code>, o <code>keyup</code>) identifica el tipo de acción realizada.</p>
+
+<div class="note"><strong>Nota:</strong> El <code>KeyboardEvent</code> solo indica qué está pasando en una tecla. Cuando necesite manejar la entrada de texto, use el evento <code><a href="/en-US/docs/DOM/DOM_event_reference/input" rel="custom">input</a></code> de HTML5 en su lugar. Por ejemplo, si el usuario introduce texto desde un sistema de tipo manuscrito como una tableta, los eventos para teclas no podrán ser lanzados.</div>
+
+<h2 id="Constructor">Constructor</h2>
+
+<dl>
+ <dt>{{domxref("KeyboardEvent.KeyboardEvent", "KeyboardEvent()")}}</dt>
+ <dd>Crea un objeto <code>KeyboardEvent</code>.</dd>
+</dl>
+
+<h2 id="Métodos">Métodos</h2>
+
+<p><em>Esta interfaz también hereda métodos de sus padres, {{domxref("UIEvent")}} and {{domxref("Event")}}.</em></p>
+
+<dl>
+ <dt>{{domxref("KeyboardEvent.getModifierState()")}}</dt>
+ <dd>Devuelve un {{jsxref("Boolean")}} indicando si una tecla modificadora, como <kbd>Alt</kbd>, <kbd>Shift</kbd>, <kbd>Ctrl</kbd>, o <kbd>Meta</kbd>, fue pulsada cuando el evento fue creado.</dd>
+ <dt>{{domxref("KeyboardEvent.initKeyEvent()")}}{{deprecated_inline}}</dt>
+ <dd>Inicializa un objeto <code>KeyboardEvent</code>. Este método solo ha sido implementado por Gecko (otros usados {{domxref("KeyboardEvent.initKeyboardEvent()")}}) y nunca más será usado. El modo estándar moderno es usar el constructor {{domxref("KeyboardEvent.KeyboardEvent", "KeyboardEvent()")}}.</dd>
+ <dt>{{domxref("KeyboardEvent.initKeyboardEvent()")}}{{deprecated_inline}}</dt>
+ <dd>Inicializa un objeto <code>KeyboardEvent</code>. Este método nunca fue implementado por Gecko (quien usa {{domxref("KeyboardEvent.initKeyEvent()")}}) y no debe ser utilizado más. El modo estándar moderno es usar el constructor {{domxref("KeyboardEvent.KeyboardEvent", "KeyboardEvent()")}}.</dd>
+</dl>
+
+<h2 id="Propiedades">Propiedades</h2>
+
+<p><em>Esta interfaz también hereda propiedades de sus padres {{domxref("UIEvent")}} y {{domxref("Event")}}.</em></p>
+
+<dl>
+ <dt>{{domxref("KeyboardEvent.altKey")}} {{Readonlyinline}}</dt>
+ <dd>Devuelve un {{jsxref("Boolean")}} que será <code>true</code> si la tecla <kbd>Alt</kbd> ( <kbd>Option</kbd> or <kbd>⌥</kbd> on OS X) fue activada cuando el evento fue generado.</dd>
+ <dt>{{domxref("KeyboardEvent.char")}} {{Non-standard_inline()}}{{Deprecated_inline}}{{Readonlyinline}}</dt>
+ <dd>Devuelve un {{domxref("DOMString")}} representando el valor del carácter de la tecla. Si la tecla corresponde con un carácter imprimible, este valor es una cadena Unicode no vacía que contiene este carácter. Si la tecla no tiene una representación imprimible, esta es una cadena vacía.</dd>
+ <dd>
+ <div class="note"><strong>Nota:</strong> Si la tecla es usada como una macro que inserta múltiples caracteres, If the key is used as a macro that inserts multiple characters, el valor de este atributo es la cadena completa, no solo el primer carácter.</div>
+
+ <div class="warning"><strong>Advertencia:</strong> Esta propiedad ha sido eliminada de los eventos del DOM de nivel 3. Esta es únicamente soportada en IE.</div>
+ </dd>
+ <dt>{{domxref("KeyboardEvent.charCode")}} {{Deprecated_inline}}{{Readonlyinline}}</dt>
+ <dd>Returns an <code>unsigned<code> </code>long</code> representing the Unicode reference number of the key; this attribute is used only by the <code>keypress</code> event. For keys whose <code>char</code> attribute contains multiple characters, this is the Unicode value of the first character in that attribute. In Firefox 26 this returns codes for printable characters.
+ <div class="warning"><strong>Warning:</strong> This attribute is deprecated; you should use <code>key</code> instead, if available.</div>
+ </dd>
+ <dt>{{domxref("KeyboardEvent.code")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{domxref("DOMString")}} with the code value of the key represented by the event.</dd>
+ <dt>{{domxref("KeyboardEvent.ctrlKey")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{jsxref("Boolean")}} that is <code>true</code> if the <kbd>Ctrl</kbd> key was active when the key event was generated.</dd>
+ <dt>{{domxref("KeyboardEvent.isComposing")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{jsxref("Boolean")}} that is <code>true</code> if the event is fired between after <code>compositionstart</code> and before <code>compositionend</code>.</dd>
+ <dt>{{domxref("KeyboardEvent.key")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{domxref("DOMString")}} representing the key value of the key represented by the event.</dd>
+ <dt>{{domxref("KeyboardEvent.keyCode")}} {{deprecated_inline()}}{{Readonlyinline}}</dt>
+ <dd>Returns an <code>unsigned long</code> representing a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
+ <div class="warning"><strong>Warning:</strong> This attribute is deprecated; you should use <code>key</code> instead, if available.</div>
+ </dd>
+ <dt>{{domxref("KeyboardEvent.locale")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{domxref("DOMString")}} representing a locale string indicating the locale the keyboard is configured for. This may be the empty string if the browser or device doesn't know the keyboard's locale.
+ <div class="note"><strong>Note:</strong> This does not describe the locale of the data being entered. A user may be using one keyboard layout while typing text in a different language.</div>
+ </dd>
+ <dt>{{domxref("KeyboardEvent.location")}}<a name="Attributes_location"> {{Readonlyinline}}</a></dt>
+ <dd>Returns an <code>unsigned long</code> representing the location of the key on the keyboard or other input device.</dd>
+ <dt>{{domxref("KeyboardEvent.metaKey")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{jsxref("Boolean")}} that is <code>true</code> if the <kbd>Meta</kbd> (or <kbd>Command</kbd> on OS X) key was active when the key event was generated.</dd>
+ <dt>{{domxref("KeyboardEvent.repeat")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{jsxref("Boolean")}} that is <code>true</code> if the key is being held down such that it is automatically repeating.</dd>
+ <dt>{{domxref("KeyboardEvent.shiftKey")}} {{Readonlyinline}}</dt>
+ <dd>Returns a {{jsxref("Boolean")}} that is <code>true</code> if the <kbd>Shift</kbd> key was active when the key event was generated.</dd>
+ <dt>{{domxref("KeyboardEvent.which")}} {{deprecated_inline}}{{Readonlyinline}}</dt>
+ <dd>Returns an <code>unsigned long</code> representing a system and implementation dependent numeric code identifying the unmodified value of the pressed key; this is usually the same as <code>keyCode</code>.
+ <div class="warning"><strong>Warning:</strong> This attribute is deprecated; you should use <code>key</code> instead, if available.</div>
+ </dd>
+</dl>
+
+<h2 id="Notes">Notes</h2>
+
+<p>There are <code>keydown</code>, <code>keypress</code>, and <code>keyup</code> events. For most keys, Gecko dispatches a sequence of key events like this:</p>
+
+<ol>
+ <li>When the key is first depressed, the <code>keydown</code> event is sent.</li>
+ <li>If the key is not a modifier key, the <code>keypress</code> event is sent.</li>
+ <li>When the user releases the key, the <code>keyup</code> event is sent.</li>
+</ol>
+
+<h3 id="Special_cases">Special cases</h3>
+
+<p>Certain keys toggle the state of an LED indicator, such as Caps Lock, Num Lock, and Scroll Lock. On Windows and Linux, these keys dispatch only the <code>keydown</code> and <code>keyup</code> events. Note that on Linux, Firefox 12 and earlier also dispatched the <code>keypress</code> event for these keys.</p>
+
+<p>On Mac, however, Caps Lock dispatches only the <code>keydown</code> event due to a platform event model limitation. Num Lock had been supported on old MacBook (2007 model and older) but Mac hasn't supported Num Lock feature even on external keyboards in these days. On the old MacBook which has Num Lock key, Num Lock doesn't cause any key events. And Gecko supports Scroll Lock key if an external keyboard which has F14 is connected. However, it generates <code>keypress</code> event. This inconsistent behavior is a bug; see {{bug(602812)}}.</p>
+
+<h3 id="Auto-repeat_handling">Auto-repeat handling</h3>
+
+<p>When a key is pressed and held down, it begins to auto-repeat. This results in a sequence of events similar to the following being dispatched:</p>
+
+<ol>
+ <li><code>keydown</code></li>
+ <li><code>keypress</code></li>
+ <li><code>keydown</code></li>
+ <li><code>keypress</code></li>
+ <li>&lt;&lt;repeating until the user releases the key&gt;&gt;</li>
+ <li><code>keyup</code></li>
+</ol>
+
+<p>This is what the DOM Level 3 specification says should happen. There are some caveats, however, as described below.</p>
+
+<h4 id="Auto-repeat_on_some_GTK_environments_such_as_Ubuntu_9.4">Auto-repeat on some GTK environments such as Ubuntu 9.4</h4>
+
+<p>In some GTK-based environments, auto-repeat dispatches a native key-up event automatically during auto-repeat, and there's no way for Gecko to know the difference between a repeated series of keypresses and an auto-repeat. On those platforms, then, an auto-repeat key will generate the following sequence of events:</p>
+
+<ol>
+ <li><code>keydown</code></li>
+ <li><code>keypress</code></li>
+ <li><code>keyup</code></li>
+ <li><code>keydown</code></li>
+ <li><code>keypress</code></li>
+ <li><code>keyup</code></li>
+ <li>&lt;&lt;repeating until the user releases the key&gt;&gt;</li>
+ <li><code>keyup</code></li>
+</ol>
+
+<p>In these environments, unfortunately, there's no way for web content to tell the difference between auto-repeating keys and keys that are just being pressed repeatedly.</p>
+
+<h4 id="Auto-repeat_handling_prior_to_Gecko_4.0">Auto-repeat handling prior to Gecko 4.0</h4>
+
+<p>Before Gecko 4.0 {{geckoRelease('4.0')}}, keyboard handling was less consistent across platforms.</p>
+
+<dl>
+ <dt>Windows</dt>
+ <dd>Auto-repeat behavior is the same as in Gecko 4.0 and later.</dd>
+ <dt>Mac</dt>
+ <dd>After the initial keydown event, only keypress events are sent until the keyup event occurs; the inter-spaced keydown events are not sent.</dd>
+ <dt>Linux</dt>
+ <dd>The event behavior depends on the specific platform. It will either behave like Windows or Mac depending on what the native event model does.</dd>
+</dl>
+
+<h2 id="Example">Example</h2>
+
+<pre class="brush: js">&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+var metaChar = false;
+var exampleKey = 16;
+
+function keyEvent(event) {
+ var key = event.keyCode || event.which;
+ var keychar = String.fromCharCode(key);
+ if (key == exampleKey) {
+ metaChar = true;
+ }
+ if (key != exampleKey) {
+ if (metaChar) {
+ alert("Combination of metaKey + " + keychar);
+ metaChar = false;
+ } else {
+ alert("Key pressed " + key);
+ }
+ }
+}
+
+function metaKeyUp (event) {
+ var key = event.keyCode || event.which;
+
+ if (key == exampleKey) {
+ metaChar = false;
+ }
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onkeydown="keyEvent(event)" onkeyup="metaKeyUp(event)"&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM3 Events', '#interface-KeyboardEvent', 'KeyboardEvent')}}</td>
+ <td>{{Spec2('DOM3 Events')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>The <code>KeyboardEvent</code> interface specification went through numerous draft versions, first under DOM Events Level 2 where it was dropped as no consensus arose, then under DOM Events Level 3. This led to the implementation of non-standard initialization methods, the early DOM Events Level 2 version, {{domxref("KeyboardEvent.initKeyEvent()")}} by Gecko browsers and the early DOM Events Level 3 version, {{domxref("KeyboardEvent.initKeyboardEvent()")}} by others. Both have been superseded by the modern usage of a constructor: {{domxref("KeyboardEvent.KeyboardEvent", "KeyboardEvent()")}}.</p>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ <tr>
+ <td>constructor</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatGeckoDesktop("31.0") }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.char</code></td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ <tr>
+ <td><code>.charCode</code></td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.code</code></td>
+ <td colspan="5" rowspan="1">See Browser compatibility of {{domxref("KeyboardEvent.code")}}.</td>
+ </tr>
+ <tr>
+ <td><code>.isComposing</code></td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatGeckoDesktop("31.0") }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ <tr>
+ <td><code>.key</code></td>
+ <td colspan="5" rowspan="1">See Browser compatibility of {{domxref("KeyboardEvent.key")}}.</td>
+ </tr>
+ <tr>
+ <td><code>.keyCode</code></td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.locale</code></td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ <tr>
+ <td><code>.location</code></td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatGeckoDesktop("15.0") }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ <tr>
+ <td><code>.repeat</code></td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatGeckoDesktop("28.0") }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ <tr>
+ <td><code>.which</code></td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.getModifierState()</code></td>
+ <td colspan="5" rowspan="1">See Browser compatibility of {{domxref("KeyboardEvent.getModifierState")}}</td>
+ </tr>
+ <tr>
+ <td><code>.initKeyboardEvent()</code></td>
+ <td>{{ CompatVersionUnknown() }} *1</td>
+ <td>{{ CompatNo() }} *2</td>
+ <td>{{ CompatIE("9.0") }} *3</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }} *1</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td>constructor</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatGeckoMobile("31.0") }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.char</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.charCode</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.code</code></td>
+ <td colspan="5" rowspan="1">See Browser compatibility of {{domxref("KeyboardEvent.code")}}.</td>
+ </tr>
+ <tr>
+ <td><code>.isComposing</code></td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatGeckoMobile("31.0") }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ <tr>
+ <td><code>.key</code></td>
+ <td colspan="6">See Browser compatibility table of {{domxref("KeyboardEvent.key")}}.</td>
+ </tr>
+ <tr>
+ <td><code>.keyCode</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.locale</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.location</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatGeckoMobile("15.0") }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.repeat</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatGeckoMobile("28.0") }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.which</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ <tr>
+ <td><code>.getModifierState()</code></td>
+ <td colspan="5" rowspan="1">See Browser compatibility of {{domxref("KeyboardEvent.getModifierState")}}</td>
+ </tr>
+ <tr>
+ <td><code>.initKeyboardEvent()</code></td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p><br>
+ *1 The arguments of <code>initKeyboardEvent()</code> of WebKit and Blink's are different from the definition in DOM Level 3 Events. The method is: <code>initKeyboardEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg,  in views::AbstractView viewArg, in DOMString keyIndentifierArg, in unsigned long locationArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in boolean altGraphKeyArg)</code></p>
+
+<p><code>*2</code> Gecko won't support <code>initKeyboardEvent()</code> because supporting it completely breaks feature detection of web applications. See {{Bug(999645)}}.</p>
+
+<p>*3 The argument of initKeyboardEvent() of IE is different from the definition in DOM Level 3 Events. The method is: <code>initKeyboardEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in views::AbstractView viewArg, in DOMString keyArg, in unsigned long locationArg, in DOMString modifierListArg, in boolean repeatArt, in DOMString locationArg)</code>. See <a href="http://msdn.microsoft.com/en-us/library/ie/ff975297%28v=vs.85%29.aspx">document of <code>initKeyboardEvent()</code> in MSDN</a>.</p>
diff --git a/files/es/web/api/keyboardevent/key/index.html b/files/es/web/api/keyboardevent/key/index.html
new file mode 100644
index 0000000000..ed765b38b3
--- /dev/null
+++ b/files/es/web/api/keyboardevent/key/index.html
@@ -0,0 +1,212 @@
+---
+title: KeyboardEvent.key
+slug: Web/API/KeyboardEvent/key
+translation_of: Web/API/KeyboardEvent/key
+---
+<p>{{APIRef("DOM Events")}}</p>
+
+<p><span class="seoSummary">La propiedad de solo lectura<strong> </strong><code><strong>KeyboardEvent.key</strong></code> retorna el valor de la tecla presionada por el usuario while taking into considerations the state of modifier keys such as the <code>shiftKey</code> as well as the keyboard locale/layout.</span> Its value is determined as follows:</p>
+
+<div class="pull-aside">
+<p class="moreinfo">See a full list of <a href="/docs/Web/API/KeyboardEvent/key/Key_Values">key values</a>.</p>
+</div>
+
+<ul>
+ <li>Si la tecla presionada tiene una representación impresa, el valor devuelto es una cadena de caracteres Unicode no-vacía que contiene la representación imprimible de la tecla.</li>
+ <li>Si la tecla presionada es un control o un carácter especial, el valor devuelto es uno de los <a href="/docs/Web/API/KeyboardEvent/key/Key_Values">valores clave definidos</a>.</li>
+ <li>If the <code>KeyboardEvent</code> represents the press of a dead key, the key value must be "<code>Dead</code>".</li>
+ <li>Some specialty keyboard keys (such as the extended keys for controlling media on multimedia keyboards) don't generate key codes on Windows; instead, they trigger <code>WM_APPCOMMAND</code> events. These events get mapped to DOM keyboard events, and are listed among the "Virtual key codes" for Windows, even though they aren't actually key codes.</li>
+ <li>If the key cannot be identified, the returned value is <code>"Unidentified"</code>.</li>
+</ul>
+
+<h2 id="KeyboardEvent_Sequence">KeyboardEvent Sequence</h2>
+
+<p><code>KeyboardEvent</code>s are fired in a pre-determined sequence and understanding this will go a long way into understanding the <code>key</code> property value for a particular <code>KeyboardEvent</code>. For a given key press, the sequence of <code>KeyboardEvent</code>s fired is as follows assuming that {{domxref("Event.preventDefault")}} is not called:</p>
+
+<ol>
+ <li>A {{event("keydown")}} event is first fired. If the key is held down further and the key produces a character key, then the event continues to be emitted in a platform implementation dependent interval and the {{domxref("KeyboardEvent.repeat")}} read only property  is set to <code>true</code>.</li>
+ <li>If the key produces a character key that would result in a character being inserted into possibly an {{HTMLElement("input")}}, {{HTMLElement("textarea")}} or an element with {{domxref("HTMLElement.contentEditable")}} set to true, the {{event("beforeinput")}} and {{event("input")}} event types are fired in that order. Note that some other implementations may fire {{event("keypress")}} event if supported. The events will be fired repeatedly while the key is held down.</li>
+ <li>A {{event("keyup")}} event is fired once the key is released. This completes the process.</li>
+</ol>
+
+<p>In sequence 1 &amp; 3, the <code>KeyboardEvent.key</code> attribute is defined and is set appropriately to a value according to the rules defined ealier.</p>
+
+<h2 id="KeyboardEvent_Sequence_Sample">KeyboardEvent Sequence Sample</h2>
+
+<p>Consider the event sequence generated when we interact with the <code>ShiftKey</code> and the legend <code>key 2</code> using a U.S keyboard layout and a UK keyboard layout.</p>
+
+<p>Try experimenting using the following two test cases:</p>
+
+<ol>
+ <li>Press and hold the <code>shift</code> key, then press <code>key 2</code> and release it. Next, release the <code>shift</code> key.</li>
+ <li>Press and hold the <code>shift</code> key, then press and hold <code>key 2</code>. Release the <code>shift</code> key. Finally, release <code>key 2</code>.</li>
+</ol>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;div class="fx"&gt;
+  &lt;div&gt;
+  &lt;textarea rows="5" name="test-target" id="test-target"&gt;&lt;/textarea&gt;
+  &lt;button type="button" name="btn-clear-console" id="btn-clear-console"&gt;clear console&lt;/button&gt;
+  &lt;/div&gt;
+  &lt;div class="flex"&gt;
+  &lt;div id="console-log"&gt;&lt;/div&gt;
+  &lt;/div&gt;
+&lt;/div&gt;
+</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">.fx {
+  -webkit-display: flex;
+ display: flex;
+  margin-left: -20px;
+  margin-right: -20px;
+}
+
+.fx &gt; div {
+ padding-left: 20px;
+ padding-right: 20px;
+}
+
+.fx &gt; div:first-child {
+ width: 30%;
+}
+
+.flex {
+ -webkit-flex: 1;
+  flex: 1;
+}
+
+#test-target {
+  display: block;
+  width: 100%;
+  margin-bottom: 10px;
+}</pre>
+
+<h3 id="JavaScript">JavaScript</h3>
+
+<pre class="brush: js">let textarea = document.getElementById('test-target'),
+consoleLog = document.getElementById('console-log'),
+btnClearConsole = document.getElementById('btn-clear-console');
+
+function logMessage(message) {
+  let p = document.createElement('p');
+  p.appendChild(document.createTextNode(message));
+  consoleLog.appendChild(p);
+}
+
+textarea.addEventListener('keydown', (e) =&gt; {
+  if (!e.repeat)
+  logMessage(`first keydown event. key property value is "${e.key}"`);
+  else
+  logMessage(`keydown event repeats. key property value is "${e.key}"`);
+});
+
+textarea.addEventListener('beforeinput', (e) =&gt; {
+  logMessage(`beforeinput event. you are about inputing "${e.data}"`);
+});
+
+textarea.addEventListener('input', (e) =&gt; {
+  logMessage(`input event. you have just inputed "${e.data}"`);
+});
+
+textarea.addEventListener('keyup', (e) =&gt; {
+  logMessage(`keyup event. key property value is "${e.key}"`);
+});
+
+btnClearConsole.addEventListener('click', (e) =&gt; {
+  let child = consoleLog.firstChild;
+  while (child) {
+  consoleLog.removeChild(child);
+  child = consoleLog.firstChild;
+  }
+});</pre>
+
+<h3 id="Result">Result</h3>
+
+<p>{{EmbedLiveSample('KeyboardEvent_Sequence_Sample')}}</p>
+
+<h3 id="Case_1">Case 1</h3>
+
+<p>When the shift key is pressed, a {{event("keydown")}} event is first fired, and the <code>key</code> property value is set to the string <code>"Shift"</code>. As we keep holding this key, the {{event("keydown")}} event does not continue to fire repeatedly because it does not produce a character key.</p>
+
+<p>When <code>key 2</code> is pressed, another {{event("keydown")}} event is fired for this new key press, and the <code>key</code> property value for the event is set to the string <code>"@"</code> for the U.S keyboard type and <code>"""</code> for the UK keyboard type, because of the active modifier <code>shift</code> key. The {{event("beforeinput")}} and {{event("input")}} events are fired next because a character key has been produced.</p>
+
+<p>As we release the <code>key 2</code>, a {{event("keyup")}} event is fired and the <code>key</code> property will maintain the string values <code>"@"</code> and <code>"""</code> for the different keyboard layouts respectively.</p>
+
+<p>As we finally release the <code>shift</code> key, another {{event("keyup")}} event is fired for it, and the key attribute value remains <code>"Shift"</code>.</p>
+
+<h3 id="Case_2">Case 2</h3>
+
+<p>When the shift key is pressed, a {{event("keydown")}} event is first fired, and the <code>key</code> property value is set to be the string <code>"Shift"</code>. As we keep holding this key, the keydown event does not continue to fire repeatedly because it produced no character key.</p>
+
+<p>When <code>key 2</code> is pressed, another {{event("keydown")}} event is fired for this new key press, and the <code>key</code> property value for the event is set to be the string <code>"@"</code> for the U.S keyboard type and <code>"""</code> for the UK keyboard type, because of the active modifier <code>shift</code> key. The {{event("beforeinput")}} and {{event("input")}} events are fired next because a character key has been produced. As we keep holding the key, the {{event("keydown")}} event continues to fire repeatedly and the {{domxref("KeyboardEvent.repeat")}}  property is set to <code>true</code>. The {{event("beforeinput")}} and {{event("input")}} events are fired repeatedly as well.</p>
+
+<p>As we release the <code>shift</code> key, a {{event("keyup")}} event is fired for it, and the key attribute value remains <code>"Shift"</code>. At this point, notice that the <code>key</code> property value for the repeating keydown event of the <code>key 2</code> key press is now "2" because the modifier <code>shift</code> key is no longer active. The same goes for the {{domxref("InputEvent.data")}} property of the {{event("beforeinput")}} and {{event("input")}} events.</p>
+
+<p>As we finally release the <code>key 2</code>, a {{event("keyup")}} event is fired but the <code>key</code> property will be set to the string value <code>"2"</code> for both keyboard layouts because the modifier <code>shift</code> key is no longer active.</p>
+
+<h2 id="Example">Example</h2>
+
+<p>This example uses {{domxref("EventTarget.addEventListener()")}} to listen for {{event("keydown")}} events. When they occur,  the key's value is checked to see if it's one of the keys the code is interested in, and if it is, it gets processed in some way (possibly by steering a spacecraft, perhaps by changing the selected cell in a spreadsheet).</p>
+
+<pre class="brush: js">window.addEventListener("keydown", function (event) {
+ if (event.defaultPrevented) {
+ return; // Do nothing if the event was already processed
+ }
+
+ switch (event.key) {
+ case "Down": // IE specific value
+ case "ArrowDown":
+ // Do something for "down arrow" key press.
+ break;
+ case "Up": // IE specific value
+ case "ArrowUp":
+ // Do something for "up arrow" key press.
+ break;
+ case "Left": // IE specific value
+ case "ArrowLeft":
+ // Do something for "left arrow" key press.
+ break;
+ case "Right": // IE specific value
+ case "ArrowRight":
+ // Do something for "right arrow" key press.
+ break;
+ case "Enter":
+ // Do something for "enter" or "return" key press.
+ break;
+ case "Escape":
+ // Do something for "esc" key press.
+ break;
+ default:
+ return; // Quit when this doesn't handle the key event.
+ }
+
+ // Cancel the default action to avoid it being handled twice
+ event.preventDefault();
+}, true);
+</pre>
+
+<h2 id="Specification">Specification</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM3 Events', '#widl-KeyboardEvent-key', 'KeyboardEvent.key')}}</td>
+ <td>{{Spec2('DOM3 Events')}}</td>
+ <td>Initial definition, included key values.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("api.KeyboardEvent.key")}}</p>
diff --git a/files/es/web/api/keyboardevent/metakey/index.html b/files/es/web/api/keyboardevent/metakey/index.html
new file mode 100644
index 0000000000..7a83c5c0b2
--- /dev/null
+++ b/files/es/web/api/keyboardevent/metakey/index.html
@@ -0,0 +1,131 @@
+---
+title: KeyboardEvent.metaKey
+slug: Web/API/KeyboardEvent/metaKey
+tags:
+ - Evento
+ - Referencia
+translation_of: Web/API/KeyboardEvent/metaKey
+---
+<p>{{APIRef("DOM Events")}}</p>
+
+<p>La propiedad <strong><code>KeyboardEvent.metaKey</code></strong>  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.</p>
+
+<div class="note">
+<p><strong>Nota:</strong> En teclados Macintosh es la tecla comando (<kbd>⌘</kbd>). En teclados Windows la tecla es lla tecla window (<kbd>⊞</kbd>).</p>
+</div>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">var metaKeyPressed = <em>instanceOfKeyboardEvent</em>.metaKey
+</pre>
+
+<h3 id="Valor_de_retorno">Valor de retorno</h3>
+
+<p>{{jsxref("Boolean")}}</p>
+
+<h2 id="Example" name="Example">Ejemplo</h2>
+
+<pre class="brush: 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);
+ }
+ }
+</pre>
+
+<h2 id="metaKey" name="metaKey">metaKey</h2>
+
+<h3 id="Contenido_HTML">Contenido HTML</h3>
+
+<pre class="brush: html">&lt;div id="example" onmousedown="ismetaKey(event);"&gt;¡Presiona la tecla meta y dame click!&lt;div&gt;
+</pre>
+
+<h3 id="Contenido_Javascript">Contenido Javascript</h3>
+
+<pre class="brush: 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!&lt;/br&gt;metaKey:"+mK;//Muestra el valor de metaKey
+}
+</pre>
+
+<p> </p>
+
+<p>{{ EmbedLiveSample('metaKey') }}</p>
+
+<h2 id="Especificaciones">Especificaciones</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificación</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentario</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM3 Events','#widl-KeyboardEvent-metaKey','KeyboardEvent.metaKey')}}</td>
+ <td>{{Spec2('DOM3 Events')}}</td>
+ <td>Definición inicial</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">Compatibilidad de Navegadores</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Firefox (Gecko)</th>
+ <th>Chrome</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Soporte Básico</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ <td>{{CompatVersionUnknown()}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Android</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Soporte Básico</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also" name="See_also">Ver también</h2>
+
+<ul>
+ <li>{{ domxref("KeyboardEvent") }}</li>
+</ul>
diff --git a/files/es/web/api/keyboardevent/which/index.html b/files/es/web/api/keyboardevent/which/index.html
new file mode 100644
index 0000000000..11e1e3e48e
--- /dev/null
+++ b/files/es/web/api/keyboardevent/which/index.html
@@ -0,0 +1,62 @@
+---
+title: event.which
+slug: Web/API/KeyboardEvent/which
+tags:
+ - DOM
+ - events
+ - metodo
+ - which
+translation_of: Web/API/KeyboardEvent/which
+---
+<p>{{ ApiRef() }}</p>
+<h3 id="Summary" name="Summary">Resumen</h3>
+<p>Devuelve el <code>keyCode</code> de la tecla presionada, o el codigo del caracter (<code>charCode</code>) de la tecla alfanumerica presionada.</p>
+<h3 id="Syntax" name="Syntax">Sintaxis</h3>
+<pre class="eval"><em>var keyResult</em> = event.which;
+</pre>
+<p><code>keyResult</code> contiene el codigo numerico para una tecla en particular, dependiendo si la tecla presionada es alfanumerica o no-alfanumerica. Por favor mire <code><a href="/en/DOM/event.charCode" title="en/DOM/event.charCode">charCode</a></code> y <code><a href="/en/DOM/event.keyCode" title="en/DOM/event.keyCode">keyCode</a></code> para mas informacion.</p>
+<h3 id="Example" name="Example">Ejemplo</h3>
+<pre>&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;charCode/keyCode/which example&lt;/title&gt;
+
+&lt;script type="text/javascript"&gt;
+
+function showKeyPress(evt)
+{
+alert("onkeypress handler: \n"
+ + "keyCode property: " + evt.keyCode + "\n"
+ + "which property: " + evt.which + "\n"
+ + "charCode property: " + evt.charCode + "\n"
+ + "Character Key Pressed: "
+ + String.fromCharCode(evt.charCode) + "\n"
+ );
+}
+
+
+function keyDown(evt)
+{
+alert("onkeydown handler: \n"
+ + "keyCode property: " + evt.keyCode + "\n"
+ + "which property: " + evt.which + "\n"
+ );
+}
+
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body
+ onkeypress="showKeyPress(event);"
+ onkeydown="keyDown(event);"
+&gt;
+
+&lt;p&gt;Por favor presione cualquier tecla.&lt;/p&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+<div class="note">
+ <strong>Nota:</strong> El codigo de arriba falla en Firefox 9 debido al <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=696020" title="onkeypress attribute on body no longer gets events happening on the window">bug 696020</a>.</div>
+<h3 id="Specification" name="Specification">Especificacion</h3>
+<p>No es parte de ninguna especificacion.</p>