bug 17310 - define where gamepad events are dispatched
authorTed Mielczarek <ted@mielczarek.org>
Fri, 22 Mar 2013 15:52:57 -0400
changeset 202d5e28445938
parent 19 27b047265c4d
child 21 525a75b3f011
bug 17310 - define where gamepad events are dispatched
gamepad.html
     1.1 --- a/gamepad.html	Fri Mar 22 10:21:33 2013 -0400
     1.2 +++ b/gamepad.html	Fri Mar 22 15:52:57 2013 -0400
     1.3 @@ -415,12 +415,19 @@
     1.4        <h3 id="event-gamepadconnected">The <dfn class="event">gamepadconnected</dfn> event</h3>
     1.5  
     1.6          <p>
     1.7 +          User agents implementing this specification must provide a new DOM
     1.8 +          event, named <code>gamepadconnected</code>. The corresponding event
     1.9 +          MUST be of type <code>GamepadEvent</code> and MUST fire on the
    1.10 +          <code>window</code> object. Registration for and firing of the
    1.11 +          <code>gamepadconnected</code> event MUST follow the usual behavior
    1.12 +          of DOM4 Events. [[!DOM4]]
    1.13 +        </p>
    1.14  
    1.15 +        <p>
    1.16            A <a>user agent</a> MUST dispatch this event type to indicate the
    1.17            user has connected a gamepad. If a gamepad was already connected
    1.18 -          when the page was loaded, the <a>gamepadconnected</a> event will be
    1.19 +          when the page was loaded, the <a>gamepadconnected</a> event SHOULD be
    1.20            dispatched when the user presses a button or moves an axis.
    1.21 -
    1.22          </p>
    1.23  
    1.24      </section>
    1.25 @@ -430,12 +437,20 @@
    1.26          <h3 id="event-gamepaddisconnected">The <dfn class="event">gamepaddisconnected</dfn> event</h3>
    1.27  
    1.28          <p>
    1.29 +          User agents implementing this specification must provide a new DOM
    1.30 +          event, named <code>gamepaddisconnected</code>. The corresponding event
    1.31 +          MUST be of type <code>GamepadEvent</code> and MUST fire on the
    1.32 +          <code>window</code> object. Registration for and firing of the
    1.33 +          <code>gamepaddisconnected</code> event MUST follow the usual behavior
    1.34 +          of DOM4 Events. [[!DOM4]]
    1.35 +        </p>
    1.36  
    1.37 +        <p>
    1.38            When a gamepad is disconnected from the <a>user agent</a>, if the
    1.39            <a>user agent</a> has previously dispatched a
    1.40 -          <a>gamepadconnected</a> event, a <a>gamepaddisconnected</a> event
    1.41 -          MUST be dispatched.
    1.42 -
    1.43 +          <a>gamepadconnected</a> event for that gamepad to a window, a
    1.44 +          <a>gamepaddisconnected</a> event MUST be dispatched to that same
    1.45 +          window.
    1.46          </p>
    1.47  
    1.48      </section>