Changes

Jump to: navigation, search

Implementing the Mouse Lock API in Firefox

126 bytes added, 13:00, 29 November 2011
High-Level Mouse Lock Implementation Tasks
# "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"
# "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"
# Tests, tests, tests. We need tests for all aspects of the spec. The central repo with all the tests are located [https://github.com/rhung/mozilla-central/tree/mouselock-tests here]. List tests we need below:
## "there is no limit to how far movement can go...not limited by screen boundaries" -- mouse lock should mean infinite movement in the X and Y axes...There will be no limit to movementX/Y values if the mouse is continuously moved in a single direction"
## "The concept of the mouse cursor will have been removed, and it will not move off the window or be clamped by a screen edge"
## "The Mouse Lock API must provide a default system action to unlock the mouse" namely ESC.
## "Once in the locked state the user agent must fire all relevant user generated MouseEvent events (for example: mousemove, mousedown, mouseup, click, wheel)[DOM-LEVEL-3-CORE] to the target of mouse lock, and not fire mouse events to other elements"
## "Events that require the concept of a mouse cursor must not be dispatched (for example: mouseover, mouseout)"- rhung
## "Movement and button presses of the mouse must not cause the window to lose focus"
## "Synthetic mouse events created by application script act the same regardless of lock state"
1
edit

Navigation menu