keypress

  • Revision slug: Web/Reference/Events/keypress
  • Revision title: keypress
  • Revision id: 402331
  • Created:
  • Creator: Sheppy
  • Is current revision? Yes
  • Comment Moved From DOM/Mozilla_event_reference/keypress to Web/Reference/Events/keypress

Revision Content

The keypress event is fired when a key is pressed down and that key normally produces a character value (use input instead).

General info

Specification
DOM L3 {{deprecated_inline()}}
Interface
KeyboardEvent
Bubbles
Yes
Cancelable
Yes
Target
Document, Element
Default Action
Varies: keypress event; launch text composition system; blur and focus events; DOMActivate event; other event

Properties

{{OpenEventProperties()}}{{UIEventProperties()}}{{KeyboardEventProperties()}}{{ModifiersEventProperties()}}{{CloseEventProperties()}}

{{KeyRelatedEvents()}}

Revision Source

<p>The <code>keypress</code> event is fired when a key is pressed down and that key normally produces a character value (use <a href="/en-US/Mozilla_event_reference/input"><code>input</code></a> instead).</p>
<h2 id="General_info">General info</h2>
<dl>
  <dt style="float: left; text-align: right; width: 120px;">
    Specification</dt>
  <dd style="margin: 0 0 0 120px;">
    <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-keyup">DOM L3</a> {{deprecated_inline()}}</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Interface</dt>
  <dd style="margin: 0 0 0 120px;">
    <a href="/en-US/docs/DOM/KeyboardEvent" title="http://en-US/docs/DOM/KeyboardEvent">KeyboardEvent</a></dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Bubbles</dt>
  <dd style="margin: 0 0 0 120px;">
    Yes</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Cancelable</dt>
  <dd style="margin: 0 0 0 120px;">
    Yes</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Target</dt>
  <dd style="margin: 0 0 0 120px;">
    Document, Element</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Default Action</dt>
  <dd style="margin: 0 0 0 120px;">
    Varies: <code>keypress</code> event; launch text composition system; <code>blur</code> and <code>focus</code> events; <code>DOMActivate</code> event; other event</dd>
</dl>
<h2 id="Properties">Properties</h2>
<p>{{OpenEventProperties()}}{{UIEventProperties()}}{{KeyboardEventProperties()}}{{ModifiersEventProperties()}}{{CloseEventProperties()}}</p>
<h2 id="Related_Events">Related Events</h2>
<p>{{KeyRelatedEvents()}}</p>
Revert to this revision