aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/uievent/index.html
blob: 8d896924ebcfea146ccea49e87dfa88aaf76f88e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
title: UIEvent
slug: Web/API/UIEvent
tags:
  - API
translation_of: Web/API/UIEvent
---
<p>{{APIRef("DOM Events")}}</p>

<p>The <strong><code>UIEvent</code></strong> interface represents simple user interface events.</p>

<p><code>UIEvent</code> derives from {{domxref("Event")}}. Though the {{domxref("UIEvent.initUIEvent()")}} method is kept for backward compatibility, creating of a <code>UIEvent</code> object should be done using the {{domxref("UIEvent.UIEvent", "UIEvent()")}} constructor.</p>

<p>Several interfaces are direct or indirect descendants of this one: {{domxref("MouseEvent")}}, {{domxref("FocusEvent")}}, {{domxref("KeyboardEvent")}}, {{domxref("WheelEvent")}}, {{domxref("InputEvent")}}, and {{domxref("CompositionEvent")}}.</p>

<h2 id="Constructors">Constructors</h2>

<dl>
 <dt>{{domxref("UIEvent.UIEvent()", "UIEvent()")}}</dt>
 <dd>Creates a <code>UIEvent</code> object.</dd>
</dl>

<h2 id="Properties">Properties</h2>

<p><em>This interface also inherits properties of its parent, {{domxref("Event")}}.</em></p>

<dl>
 <dt>{{domxref("UIEvent.cancelBubble")}} {{Deprecated_inline}}{{Non-standard_inline}}</dt>
 <dd>Is a {{jsxref("Boolean")}} indicating whether the bubbling of the event has been canceled or not.</dd>
</dl>

<dl>
 <dt>{{domxref("UIEvent.detail")}}{{readonlyinline}}</dt>
 <dd>Returns a <code>long</code> that gives some detail about the event, depending on the type of event.</dd>
 <dt>{{domxref("UIEvent.isChar")}} {{Non-standard_inline}} {{readonlyinline}}</dt>
 <dd>Returns a {{jsxref("Boolean")}} indicating whether the event produced a key character or not.</dd>
 <dt>{{domxref("UIEvent.layerX")}} {{Non-standard_inline}} {{readonlyinline}}</dt>
 <dd>Returns the horizontal coordinate of the event relative to the current layer.</dd>
 <dt>{{domxref("UIEvent.layerY")}} {{Non-standard_inline}} {{readonlyinline}}</dt>
 <dd>Returns the vertical coordinate of the event relative to the current layer.</dd>
 <dt>{{domxref("UIEvent.pageX")}} {{Non-standard_inline}} {{readonlyinline}}</dt>
 <dd>Returns the horizontal coordinate of the event relative to the whole document.</dd>
 <dt>{{domxref("UIEvent.pageY")}} {{Non-standard_inline}} {{readonlyinline}}</dt>
 <dd>Returns the vertical coordinate of the event relative to the whole document.</dd>
 <dt>{{domxref("UIEvent.view")}}{{readonlyinline}}</dt>
 <dd>Returns a {{domxref("WindowProxy")}} that contains the view that generated the event.</dd>
 <dt>{{domxref("UIEvent.which")}} {{Non-standard_inline}} {{readonlyinline}}</dt>
 <dd>Returns the numeric <code>keyCode</code> of the key pressed, or the character code (<code>charCode</code>) for an alphanumeric key pressed.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<p><em>This interface also inherits methods of its parent, {{domxref("Event")}}.</em></p>

<dl>
 <dt>{{domxref("UIEvent.initUIEvent()")}} {{deprecated_inline}}</dt>
 <dd>Initializes a <code>UIEvent</code> object. If the event has already being dispatched, this method does nothing.</dd>
</dl>

<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-UIEvent', 'UIEvent')}}</td>
   <td>{{Spec2('DOM3 Events')}}</td>
   <td>From {{SpecName('DOM2 Events')}}:
    <ul>
     <li>added the <code>UIEvent()</code> constructor,</li>
     <li>deprecated the <code>initUIEvent()</code> method,</li>
     <li>and changed the type of <code>view</code> from <code>AbstractView</code> to <code>WindowProxy</code>.</li>
    </ul>
   </td>
  </tr>
  <tr>
   <td>{{SpecName('DOM2 Events', '#Events-UIEvent', 'UIEvent')}}</td>
   <td>{{Spec2('DOM2 Events')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="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</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
  <tr>
   <td><code>UIEvent()</code></td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatGeckoDesktop(11)}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatUnknown() }}</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 Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
  <tr>
   <td><code>UIEvent()</code></td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatGeckoMobile(11)}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 class="editable" id="See_also"><span>See also</span></h2>

<ul>
 <li>{{ domxref("Event") }}</li>
</ul>