Changes

Jump to: navigation, search

Implementing the Mouse Lock API in Firefox

58 bytes added, 14:27, 5 December 2011
High-Level Mouse Lock Implementation Tasks
# <strike>Save the screenX and screenY position before locking the mouse.</strike> - humph
# <strike>Reset the mouse position back to the original position when unlocking.</strike> - humph
# <s>"When unlocked, the system cursor can exit and re-enter the user agent window. If it does so and the user agent was not the target of operating system mouse move events then the most recent mouse position will be unknown to the user agent and movementX/Y can not be computed and must be set to zero" </s> diogogmt
# <s>Trying to lock a locked element should fire the success callback</s> CloudScorpion
# <s>Before locking the mouse check if the element is a DOM element and if it is in the DOM Tree</s> diogogmt
# <s>Fix license headers for new files to use proper [http://www.mozilla.org/MPL/boilerplate-1.1/ MPL boilerplate]</s> humph
# <s>Do we need to add a user pref to enable/disable mouse lock? Nice to have, not blocking.</s> northwind, mjschranz
# "Once mouse lock is acquired, stop mouse events from being fired to other elements that are not locked (e.g., only fire to locked element)." Only the fullscreen element will get events. Need advice in review on how to do this properly.
=====Out of Scope Implementation=====
# The ESC key should exit mouse lock. This will currently exit fullscreen, and therefore mouse lock - diogogmt
# "Once mouse lock is acquired, stop mouse events from being fired to other elements that are not locked (e.g., only fire to locked element)." Only the fullscreen element will get events.
# "User agents may prompt for confirmation before locking, this preference may be saved as a content setting" How to deal with this? What UI do we use? See also, "Repeated escapes of mouse lock can signal user agent to not re-lock the mouse without more specific user intent gesture, e.g. similar to how Chrome suppresses repeated alert() calls"
# "The Mouse Lock API must exit the mouse lock state if the user agent, window, or tab loses focus"

Navigation menu