diff options
Diffstat (limited to 'files/zh-tw/web/api/pointer_lock_api/index.html')
-rw-r--r-- | files/zh-tw/web/api/pointer_lock_api/index.html | 285 |
1 files changed, 285 insertions, 0 deletions
diff --git a/files/zh-tw/web/api/pointer_lock_api/index.html b/files/zh-tw/web/api/pointer_lock_api/index.html new file mode 100644 index 0000000000..e37e5ceea5 --- /dev/null +++ b/files/zh-tw/web/api/pointer_lock_api/index.html @@ -0,0 +1,285 @@ +--- +title: Pointer Lock API +slug: Web/API/Pointer_Lock_API +translation_of: Web/API/Pointer_Lock_API +--- +<p>{{ SeeCompatTable() }}</p> + +<p><strong>Pointer lock</strong> (之前稱為 Mouse lock) 提供「隨時間經過所產生的滑鼠位移資訊 (即 deltas)」的輸入方法,而不只是滑鼠游標的絕對位置而已。此函式可存取基本的滑鼠位移、將滑鼠事件的目標鎖定至單一元素、讓滑鼠單一方向的位移距離不再受限、將游標移除到視點之外。</p> + +<p>若 App 需要大量的滑鼠輸入以控制位移、旋轉物件、更改輸入項,那此 API 就特別有用。另對特別注重視覺效果的 App 尤其必要,如第一人稱視角、3D 視圖、模型建構等。</p> + +<p>舉例來說,你可讓消費者不需點擊任何按鈕,只要透過滑鼠即可控制視角。而按鈕可用於其他動作。對於查看地圖、衛星圖像、第一人稱場景類 (如遊戲或虛擬實境影片) 的 App 來說,這種滑鼠輸入方式特別方便易用。</p> + +<p>即使滑鼠游標移出瀏覽器或螢幕之外,Pointer lock 還是能讓你存取滑鼠事件。舉例來說,消費者還是可繼續移動滑鼠以旋轉或操作 3D 模型。若沒有 Pointer lock,則只要指標移出瀏覽器或螢幕之外,旋轉或操作隨即停止。遊戲玩家會特別喜歡此功能。他們現在可以隨便亂按按鈕並隨意滑動滑鼠;不再擔心滑鼠游標滑出遊戲區域而點到其他應用程式,結果退出遊戲發生慘案!</p> + +<h2 id="basics" name="basics">基本概念</h2> + +<p>Pointer lock 與 <a href="/en/DOM/element.setCapture" title="element.setCapture">mouse capture </a>相關。在拖曳滑鼠時,Mouse capture 可持續向目標元素傳遞事件,且只要放開滑鼠按鈕隨即跟著停止。Pointer lock 與 mouse capture 不同之處在於:</p> + +<ul> + <li>Pointer lock 屬持久性。除非發生顯式 (Explicit) API 呼叫,或使用者做出特定的釋放手勢,否則 Pointer lock 將不會釋放滑鼠。</li> + <li>Pointer lock 不侷限於螢幕或瀏覽器的範圍。</li> + <li>不論滑鼠按鈕狀態為何,Pointer lock 將持續送出事件。</li> + <li>Pointer lock 會隱藏游標。</li> +</ul> + +<h2 id="example" name="example">範例</h2> + +<p>下列範例可讓你設定自己網頁上的 Pointer lock。</p> + +<pre class="brush: js"><button onclick="lockPointer();">Lock it!</button> +<div id="pointer-lock-element"></div> +<script> +// Note: at the time of writing, only Mozilla and WebKit support Pointer Lock. + +// The element we'll make fullscreen and pointer locked. +var elem; + +document.addEventListener("mousemove", function(e) { + var movementX = e.movementX || + e.mozMovementX || + e.webkitMovementX || + 0, + movementY = e.movementY || + e.mozMovementY || + e.webkitMovementY || + 0; + + // Print the mouse movement delta values + console.log("movementX=" + movementX, "movementY=" + movementY); +}, false); + +function fullscreenChange() { + if (document.webkitFullscreenElement === elem || + document.mozFullscreenElement === elem || + document.mozFullScreenElement === elem) { // Older API upper case 'S'. + // Element is fullscreen, now we can request pointer lock + elem.requestPointerLock = elem.requestPointerLock || + elem.mozRequestPointerLock || + elem.webkitRequestPointerLock; + elem.requestPointerLock(); + } +} + +document.addEventListener('fullscreenchange', fullscreenChange, false); +document.addEventListener('mozfullscreenchange', fullscreenChange, false); +document.addEventListener('webkitfullscreenchange', fullscreenChange, false); + +function pointerLockChange() { + if (document.mozPointerLockElement === elem || + document.webkitPointerLockElement === elem) { + console.log("Pointer Lock was successful."); + } else { + console.log("Pointer Lock was lost."); + } +} + +document.addEventListener('pointerlockchange', pointerLockChange, false); +document.addEventListener('mozpointerlockchange', pointerLockChange, false); +document.addEventListener('webkitpointerlockchange', pointerLockChange, false); + +function pointerLockError() { + console.log("Error while locking pointer."); +} + +document.addEventListener('pointerlockerror', pointerLockError, false); +document.addEventListener('mozpointerlockerror', pointerLockError, false); +document.addEventListener('webkitpointerlockerror', pointerLockError, false); + +function lockPointer() { + elem = document.getElementById("pointer-lock-element"); + // Start by going fullscreen with the element. Current implementations + // require the element to be in fullscreen before requesting pointer + // lock--something that will likely change in the future. + elem.requestFullscreen = elem.requestFullscreen || + elem.mozRequestFullscreen || + elem.mozRequestFullScreen || // Older API upper case 'S'. + elem.webkitRequestFullscreen; + elem.requestFullscreen(); +} +</script> +</pre> + +<h2 id="method_overview" name="method_overview"><strong>函式/屬性概述</strong></h2> + +<p>Pointer lock API 與 Fullscreen API 類似,可添增 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.requestPointerLock" title="The requestPointerLock allows to asynchronously ask for the pointer to be locked on the given element.">requestPointerLock</a> 新函式 (目前尚未標準化) 而擴充 DOM 元素。可為下列:</p> + +<pre class="brush: js">element.webkitRequestPointerLock(); // Chrome +element.mozRequestPointerLock(); // Firefox +element.requestPointerLock(); // Standard</pre> + +<p>目前在建置 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.requestPointerLock" title="The requestPointerLock allows to asynchronously ask for the pointer to be locked on the given element.">requestPointerLock</a> 時,還是必須緊密結合 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.requestFullScreen" title="Asynchronously requests that the element be made full-screen.">requestFullScreen</a> 與 Fullscreen API。在指標鎖定某一元素之前,必須先進入全螢幕模式。如同上方的 Demo,指標鎖定屬於非同步程序,並透過 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.pointerlockchange" title="/en-US/docs/Web/API/GlobalEventHandlers.pointerlockchange">pointerlockchange</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.pointerlockerror" title="/en-US/docs/Web/API/GlobalEventHandlers.pointerlockerror">pointerlockerror</a> 事件,指出該請求是否成功。此與 Fullscreen API 的運作方式相同 (使用其 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.requestFullScreen" title="Asynchronously requests that the element be made full-screen.">requestFullScreen</a> 函式,另搭配 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.fullscreenchange" title="/en-US/docs/Web/API/GlobalEventHandlers.fullscreenchange">fullscreenchange</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.fullscreenerror" title="/en-US/docs/Web/API/GlobalEventHandlers.fullscreenerror">fullscreenerror</a> 事件)。</p> + +<p>Pointer lock API 另擴充了 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document" title="Each web page loaded in the browser has its own document object. The Document interface serves as an entry point to the web page's content (the DOM tree, including elements such as <body> and <table>) and provides functionality global to the document (suc">Document</a> 介面,同時添增了新的屬性與函式。如果目前有鎖定的元素,則新的屬性可存取該所訂元素,並命名為 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.pointerLockElement" title="The pointerLockElement property provides the element set as the target for mouse events while the pointer is locked. It is null if lock is pending, pointer is unlocked, or the target is in another document.">pointerLockElement</a> (目前尚未標準化)。<a href="https://developer.mozilla.org/en-US/docs/Web/API/Document" title="Each web page loaded in the browser has its own document object. The Document interface serves as an entry point to the web page's content (the DOM tree, including elements such as <body> and <table>) and provides functionality global to the document (suc">Document</a> 上的新函式則為 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.exitPointerLock" title="The exitPointerLock asynchronously releases a pointer lock previously requested through Element.requestPointerLock.">exitPointerLock</a>;顧名思義,此函式可退出 Pointer lock。</p> + +<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.pointerLockElement" title="The pointerLockElement property provides the element set as the target for mouse events while the pointer is locked. It is null if lock is pending, pointer is unlocked, or the target is in another document.">pointerLockElement</a> 屬性可確定指標目前是否鎖定了任何元素 (例如進行 Boolean 檢查)。若確實有鎖定的元素,則可取得參考。以下為此二種用法的範例:</p> + +<pre class="brush: js"><span class="idlInterface" id="idl-def-MouseLockable"><span class="idlInterface" id="idl-def-MouseLockable">document.pointerLockElement = document.pointerLockElement || + document.mozPointerLockElement || + document.webkitPointerLockElement;</span></span> + +// 1) Used as a boolean check: are we pointer locked? +if (!!document.pointerLockElement) { + // pointer is locked +} else { + // pointer is not locked +} + +// 2) Used to access the pointer locked element +if (document.pointerLockElement === someElement) { + // someElement is currently pointer locked +} +</pre> + +<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.exitPointerLock" title="The exitPointerLock asynchronously releases a pointer lock previously requested through Element.requestPointerLock.">Document.exitPointerLock</a> 函式則用以退出 Pointer lock。且和 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.requestPointerLock" title="The requestPointerLock allows to asynchronously ask for the pointer to be locked on the given element.">requestPointerLock</a> 一樣,<a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.exitPointerLock" title="The exitPointerLock asynchronously releases a pointer lock previously requested through Element.requestPointerLock.">Document.exitPointerLock</a> 是使用 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.pointerlockchange" title="/en-US/docs/Web/API/GlobalEventHandlers.pointerlockchange">pointerlockchange</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.pointerlockerror" title="/en-US/docs/Web/API/GlobalEventHandlers.pointerlockerror">pointerlockerror</a> 事件,以非同步方式作業:</p> + +<pre class="brush: js">document.exitPointerLock = document.exitPointerLock || + document.mozExitPointerLock || + document.webkitExitPointerLock; + +function pointerLockChange() { + document.pointerLockElement = document.pointerLockElement || + document.mozPointerLockElement || + document.webkitPointerLockElement; + + if (!!document.pointerLockElement) { + console.log("Still locked."); + } else { + console.log("Exited lock."); + } +} + +document.addEventListener('pointerlockchange', pointerLockChange, false); +document.addEventListener('mozpointerlockchange', pointerLockChange, false); +document.addEventListener('webkitpointerlockchange', pointerLockChange, false); + +// Attempt to unlock +document.exitPointerLock(); +</pre> + +<h2 id="mouselocklostevent" name="mouselocklostevent">pointerlockchange 事件</h2> + +<p>若 Pointer lock 狀態改變,如呼叫 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.requestPointerLock" title="The requestPointerLock allows to asynchronously ask for the pointer to be locked on the given element.">requestPointerLock</a>、<a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.exitPointerLock" title="The exitPointerLock asynchronously releases a pointer lock previously requested through Element.requestPointerLock.">exitPointerLock</a>,或使用者按下 ESC 鍵等。則 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.pointerlockchange" title="/en-US/docs/Web/API/GlobalEventHandlers.pointerlockchange">pointerlockchange</a> 事件隨即傳送至 <code>document</code>。此簡單事件不包含額外資料。</p> + +<div class="note">此事件目前在 Firefox 中的前綴為 <code>mozpointerlockchange</code>;在 Chrome 中的前綴為 <code>webkitpointerlockchange</code>。</div> + +<h2 id="mouselocklostevent" name="mouselocklostevent">pointerlockerror 事件</h2> + +<p>當呼叫 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element.requestPointerLock" title="The requestPointerLock allows to asynchronously ask for the pointer to be locked on the given element.">requestPointerLock</a> 或 <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document.exitPointerLock" title="The exitPointerLock asynchronously releases a pointer lock previously requested through Element.requestPointerLock.">exitPointerLock</a> 而發生錯誤時,隨即傳送 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.pointerlockerror" title="/en-US/docs/Web/API/GlobalEventHandlers.pointerlockerror">pointerlockerror</a> 事件至 <code>document</code>。此簡單事件不包含額外資料。</p> + +<div class="note">此事件在 Firefox 中的前綴為 <code>mozpointerlockerror</code>;在 Chrome 中的前綴為 <code>webkitpointerlockerror</code>。</div> + +<h2 id="extensions" name="extensions">擴充至滑鼠事件</h2> + +<p>Pointer lock API 可透過位移屬性而擴充標準的 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent" title="The DOM MouseEvent interface represents events that occur due to the user interacting with a pointing device (such as a mouse).">MouseEvent</a> 介面。</p> + +<pre class="idl"><span class="idlInterface" id="idl-def-MouseEvent">partial interface <span class="idlInterfaceID">MouseEvent</span> { +<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>long</a></span> <span class="idlAttrName"><a href="http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html#widl-MouseEvent-movementX">movementX</a></span>;</span> +<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>long</a></span> <span class="idlAttrName"><a href="http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html#widl-MouseEvent-movementY">movementY</a></span>;</span> +};</span></pre> + +<div class="note">位移屬性目前在 Firefox 中的前綴為 <code>.mozMovementX</code> 與 <code>.mozMovementY</code>;在 Chrome 中的前綴為<code>.webkitMovementX</code> 與 <code>.webkitMovementY</code>。</div> + +<p>滑鼠事件的二個新參數 (即 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementX" title="The movementX property provides the shift in the X coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementX = currentEvent.screenX - previ">movementX</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementY" title="The movementY property provides the shift in the Y coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementY = currentEvent.screenY - previ">movementY</a>) 將提供滑鼠位置的變化情形。此二項參數的值,等於 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent" title="The DOM MouseEvent interface represents events that occur due to the user interacting with a pointing device (such as a mouse).">MouseEvent</a> 屬性值 (即 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.screenX" title="The screenX property provides the X coordinate of the mouse pointer in global (screen) coordinates.">screenX</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.screenY" title="The screenY property provides the Y coordinate of the mouse pointer in global (screen) coordinates.">screenY</a>) 之間的變化;而 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent" title="The DOM MouseEvent interface represents events that occur due to the user interacting with a pointing device (such as a mouse).">MouseEvent</a> 屬性另儲存於二項連續的 <a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.mousemove" title="/en-US/docs/Web/API/GlobalEventHandlers.mousemove">mousemove</a> 事件 (即 eNow 與 ePrevious) 之內。換句話說,Pointer lock 參數 <code>movementX = eNow.screenX - ePrevious.screenX</code>。</p> + +<h3 id="locked_state" name="locked_state">鎖定狀態</h3> + +<p>在啟動 Pointer lock 之後,標準的 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent" title="The DOM MouseEvent interface represents events that occur due to the user interacting with a pointing device (such as a mouse).">MouseEvent</a> 屬性 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.clientX" title="Editorial review completed.">clientX</a>、<a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.clientY" title="The clientY property provides the Y coordinate of the mouse pointer in local (DOM content) coordinates.">clientY</a>、<a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.screenX" title="The screenX property provides the X coordinate of the mouse pointer in global (screen) coordinates.">screenX</a>、<a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.screenY" title="The screenY property provides the Y coordinate of the mouse pointer in global (screen) coordinates.">screenY</a> 均維持不變,如同滑鼠沒有移動。<a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementX" title="The movementX property provides the shift in the X coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementX = currentEvent.screenX - previ">movementX</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementY" title="The movementY property provides the shift in the Y coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementY = currentEvent.screenY - previ">movementY</a> 屬性將持續提供滑鼠的位置變化。如果滑鼠朝單一方向持續移動,<a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementX" title="The movementX property provides the shift in the X coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementX = currentEvent.screenX - previ">movementX</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementY" title="The movementY property provides the shift in the Y coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementY = currentEvent.screenY - previ">movementY</a> 的值也就不受限。此時「滑鼠游標」的概念不存在,游標無法移出視窗之外,也不會受限於螢幕邊界。</p> + +<h3 id="unlocked_state" name="unlocked_state"><strong>未鎖定狀態</strong></h3> + +<p>無論滑鼠的鎖定狀態為何,<a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementX" title="The movementX property provides the shift in the X coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementX = currentEvent.screenX - previ">movementX</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementY" title="The movementY property provides the shift in the Y coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementY = currentEvent.screenY - previ">movementY</a> 參數均保持有效;另為了方便起見,甚至在未鎖定狀態下仍可保持有效。</p> + +<p>在解鎖滑鼠之後,系統游標可退出並重新進入瀏覽器視窗,且 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementX" title="The movementX property provides the shift in the X coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementX = currentEvent.screenX - previ">movementX</a> 與 <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.movementY" title="The movementY property provides the shift in the Y coordinate of the mouse pointer between that event and the previous mousemove event. In other words, the value of that property is computed that way : currentEvent.movementY = currentEvent.screenY - previ">movementY</a> 此時可能設定為零。</p> + +<h2 id="iframe_限制">iframe 限制</h2> + +<p>Pointer lock 一次僅能鎖定一組 iframe。在鎖定一組 iframe 之後,就無法鎖定另一組 iframe 並轉移目標至該 iframe 之上;Pointer lock 將發生錯誤。為擺脫此限制,必須先將鎖定的 iframe 解鎖,再鎖定另一組 iframe。</p> + +<p>由於 iframes 是根據預設值運作,因此預設為「沙箱式 (sandboxed)」的 iframes 將阻擋 Pointer lock。為擺脫此限制,Chrome 應該很快就會推出 <code><iframe sandbox="allow-pointer-lock"></code> 的「屬性/值」整合形式。</p> + +<h2 id="規格">規格</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Pointer Lock')}}</td> + <td>{{Spec2('Pointer Lock')}}</td> + <td>Initial specification.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="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 (WebKit)</th> + </tr> + <tr> + <td>Basic support</td> + <td> + <p>Targeting 23{{ property_prefix("webkit") }}*</p> + + <p>See <a class="external" href="http://code.google.com/p/chromium/issues/detail?id=72754" title="http://code.google.com/p/chromium/issues/detail?id=72754">CR/72574</a></p> + </td> + <td> + <p>{{ CompatGeckoDesktop("14.0") }}</p> + + <p>{{bug("633602") }}</p> + </td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</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 Phone</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + </tr> + </tbody> +</table> +</div> + +<p>* 需啟動 <code>about:flags</code> 中的功能;或以 <code>--enable-pointer-lock</code> 旗標啟動 Chrome。</p> + +<h2 id="See_also" name="See_also">另可參閱</h2> + +<ul> + <li>{{domxref("MouseEvent")}}</li> +</ul> |