mouse-lock.html
changeset 146 ce0b453f3750
parent 145 6c149e83cd5d
child 147 6ce387d53cf0
equal deleted inserted replaced
145:6c149e83cd5d 146:ce0b453f3750
   194           lock is entered then mouse lock will be lost.</p>
   194           lock is entered then mouse lock will be lost.</p>
   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 dispatch the
   200           <a><code>pointerlocklost</code></a> callback for the previous target.</p>
   200           <a><code>pointerlocklost</code></a> event 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]]
   214 
   214 
   215           <p>Synthetic mouse events created by application script act the same
   215           <p>Synthetic mouse events created by application script act the same
   216           regardless of lock state.<p>
   216           regardless of lock state.<p>
   217 
   217 
   218           <dl class='parameters'>
   218           <dl class='parameters'>
   219             <dt>in Element target</dt> <dd></dd>
   219             <dt>Element target</dt> <dd></dd>
   220             <dt>in optional VoidCallback successCallback</dt> <dd></dd>
   220             <dt>optional VoidCallback successCallback</dt> <dd></dd>
   221             <dt>in optional VoidCallback failureCallback</dt> <dd></dd>
   221             <dt>optional VoidCallback failureCallback</dt> <dd></dd>
   222           </dl>
   222           </dl>
   223         </dd>
   223         </dd>
   224 
   224 
   225         <dt>void unlock ()</dt>
   225         <dt>void unlock ()</dt>
   226         <dd>
   226         <dd>
   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>readonly attribute 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 if the mouse is
   240           <p>The <code>isLocked</code> attribute is true if the mouse is
   241           currently locked.</p>
   241           currently locked and false otherwise.</p>
   242         </dd>
   242         </dd>
   243       </dl>
   243       </dl>
   244     </section>
   244     </section>
   245 
   245 
   246     <section>
   246     <section>
   292       in position of the mouse as when the mouse is unlocked.  There will be no
   292       in position of the mouse as when the mouse is unlocked.  There will be no
   293       limit to <code>movementX</code>/<code>Y</code> values if the mouse is
   293       limit to <code>movementX</code>/<code>Y</code> values if the mouse is
   294       continuously moved in a single direction.  The concept of the mouse cursor
   294       continuously moved in a single direction.  The concept of the mouse cursor
   295       will have been removed, and it will not move off the window or be clamped
   295       will have been removed, and it will not move off the window or be clamped
   296       by a screen edge.</p>
   296       by a screen edge.</p>
       
   297     </section>
       
   298 
       
   299     <section>
       
   300       <h2><a>VoidCallback</a> Interface</h2>
       
   301       <p>
       
   302         The <a>VoidCallback</a> interface is a generic callback with no parameters.
       
   303       </p>
       
   304       <dl title='[NoInterfaceObject, Callback=FunctionOnly] interface VoidCallback' class='idl'>
       
   305         <dt>void handleEvent ()</dt>
       
   306         <dd>
       
   307         </dd>
       
   308       </dl>
   297     </section>
   309     </section>
   298 
   310 
   299     <section>
   311     <section>
   300       <h2>Requirements</h2>
   312       <h2>Requirements</h2>
   301 
   313