Open main menu

CDOT Wiki β

Changes

Implementing the Mouse Lock API in Firefox

24 bytes added, 15:52, 30 November 2011
Implementation
# <strike>Mouse lock should only work when in Full Screen Mode</strike> - diogogmt, rhung
# <strike>[[Refactor nsIDOMNavigator changes for pointer attribute to be in separate interface]]</strike> humph
# Do we need to add a user pref to enable/disable mouse lock? yes :) northwind
# <strike>Do we need to do conditional compilation for mouse lock?</strike> humph (not going to bother for now)
# <strike>When mouse lock is enabled clientX, clientY, screenX, and screenY must hold constant values as if the mouse did not move at all once mouse lock was entered.</strike> humph
# <s>Freeze mouse pointer in centre of window when mouse lock is enabled (e.g., moving the mouse causes an event, but forces the mouse to go back to the original position).</s> - JSilver999
# "The Mouse Lock API must exit the mouse lock state if the user agent, window, or tab loses focus"
# <strike>"Events that require the concept of a mouse cursor must not be dispatched (for example: mouseover, mouseout)"</strike> - humph
# "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"
# <strike>Figure out [[Mac Crash with Jesse's SynthesizeMouseMove change]]</strike> humph
# <strike>When the locked element is removed from the DOM Tree, the mouse should be unlocked</strike> diogogmt
# <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
# "The Mouse Lock API must exit the mouse lock state if the user agent, window, or tab loses focus"
# "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"
# Trying to lock a locked element should fire the success callback diogogmt
# Before locking the mouse check if the element is a DOM element and if it is in the DOM Tree diogogmt
# <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
# Fix accurateness of mouse positioning on unlock() (should be the same point as when lock() was called). Currently works, but is offset. See nsEventStateManager::SetMouseLock.
# Restructure Lock method to do most of its operations in a separate thread. diogogmt
# "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"
# User agents may prompt for confirmation before locking, this preference may be saved as a content setting (Mentioned in class by humphd, setting would be in about:config ) mjschranz
# Do we need to add a user pref to enable/disable mouse lock? Nice to have, not blocking. - northwind
====Tests====