mouse-lock.html
changeset 145 6c149e83cd5d
parent 137 2a0c78eeaa2d
child 146 ce0b453f3750
equal deleted inserted replaced
141:e888fa7f393a 145:6c149e83cd5d
   150     <section>
   150     <section>
   151       <h2>Extensions to the <a>Navigator</a> Interface</h2>
   151       <h2>Extensions to the <a>Navigator</a> Interface</h2>
   152       <p>
   152       <p>
   153         The <a>Navigator</a> interface [[!NAVIGATOR]] contains a
   153         The <a>Navigator</a> interface [[!NAVIGATOR]] contains a
   154         <code>pointer</code> attribute providing access to the
   154         <code>pointer</code> attribute providing access to the
   155         <a>MouseLockable</a> interface.
   155         <a>PointerLock</a> interface.
   156       </p>
   156       </p>
   157 
   157 
   158       <dl title='partial interface Navigator' class='idl'>
   158       <dl title='partial interface Navigator' class='idl'>
   159         <dt>readonly attribute MouseLockable pointer</dt>
   159         <dt>readonly attribute PointerLock pointer</dt>
   160         <dd>
   160         <dd>
   161           <dfn title="pointer"></dfn>
   161           <dfn title="pointer"></dfn>
   162         </dd>
   162         </dd>
   163       </dl>
   163       </dl>
   164     </section>
   164     </section>
   165 
   165 
   166     <section>
   166     <section>
   167       <h2><a>MouseLockable</a> Interface</h2>
   167       <h2><a>PointerLock</a> Interface</h2>
   168       <p>
   168       <p>
   169         The <a>MouseLockable</a> interface contains methods
   169         The <a>PointerLock</a> interface contains methods
   170         providing the ability to enter, exit, and poll the state of mouse lock.
   170         providing the ability to enter, exit, and poll the state of mouse lock.
   171       </p>
   171       </p>
   172 
   172 
   173       <dl title='interface MouseLockable' class='idl'>
   173       <dl title='interface PointerLock' class='idl'>
   174         <dt>void lock ()</dt>
   174         <dt>void lock ()</dt>
   175         <dd>
   175         <dd>
   176           <dfn title="lock"></dfn>
   176           <dfn title="lock"></dfn>
   177 
   177 
   178           <p>The <code>lock</code> method requests that the mouse be locked
   178           <p>The <code>lock</code> method requests that the mouse be locked
   195 
   195 
   196           <p>If the mouse is already locked to the same element, a repeated call to
   196           <p>If the mouse is already locked to the same element, a repeated call to
   197           <code>lock</code> will succeed and the <code>successCallback</code>
   197           <code>lock</code> will succeed and the <code>successCallback</code>
   198           called.  If another element is locked a <a>user agent</a> must transfer
   198           called.  If another element is locked a <a>user agent</a> must transfer
   199           the mouse lock to the new <code>target</code> and call the
   199           the mouse lock to the new <code>target</code> and call the
   200           <a><code>mouselocklost</code></a> callback for the previous target.</p>
   200           <a><code>pointerlocklost</code></a> callback for the previous target.</p>
   201 
   201 
   202           <p>Once in the locked state the <a>user agent</a> must fire all relevant
   202           <p>Once in the locked state the <a>user agent</a> must fire all relevant
   203           user generated <code>MouseEvent</code> events (for example:
   203           user generated <code>MouseEvent</code> events (for example:
   204           <code>mousemove</code>, <code>mousedown</code>, <code>mouseup</code>,
   204           <code>mousemove</code>, <code>mousedown</code>, <code>mouseup</code>,
   205           <code>click</code>, <code>wheel</code>)[[!DOM-LEVEL-3-CORE]]
   205           <code>click</code>, <code>wheel</code>)[[!DOM-LEVEL-3-CORE]]
   231           the same location that it was when mouse lock was entered (the same
   231           the same location that it was when mouse lock was entered (the same
   232           location that is reported in <code>screenX</code>/<code>Y</code>
   232           location that is reported in <code>screenX</code>/<code>Y</code>
   233           when the mouse is locked).</p>
   233           when the mouse is locked).</p>
   234         </dd>
   234         </dd>
   235 
   235 
   236         <dt>bool islocked ()</dt>
   236         <dt>bool isLocked ()</dt>
   237         <dd>
   237         <dd>
   238           <dfn title="islocked"></dfn>
   238           <dfn title="isLocked"></dfn>
   239 
   239 
   240           <p>The <code>islocked</code> method returns true is the mouse is
   240           <p>The <code>isLocked</code> method returns true if the mouse is
   241           currently locked.</p>
   241           currently locked.</p>
   242         </dd>
   242         </dd>
   243       </dl>
   243       </dl>
   244     </section>
   244     </section>
   245 
   245 
   246     <section>
   246     <section>
   247       <h2><dfn><code>mouselocklost</code></dfn> Event</h2>
   247       <h2><dfn><code>pointerlocklost</code></dfn> Event</h2>
   248 
   248 
   249       <p>When mouse lock is lost or disabled for any reason <a>user agents</a>
   249       <p>When mouse lock is lost or disabled for any reason <a>user agents</a>
   250       must <a
   250       must <a
   251       href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire">fire
   251       href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire">fire
   252       an event</a> named <code>mouselocklost</code> with its
   252       an event</a> named <code>pointerlocklost</code> with its
   253       <code>bubble</code> attribute set to true to the mouse lock
   253       <code>bubble</code> attribute set to true to the mouse lock
   254       <a>target</a> element.</p>
   254       <a>target</a> element.</p>
   255     </section>
   255     </section>
   256 
   256 
   257     <section>
   257     <section>