InputHandler.dragTimeThreshold gives you more fine control over when a Sprite Drag event will start. It allows you to specify a time, in ms that the pointer must have been held down for, before the drag will begin.
InputHandler.downPoint is a new Point object that contains the coordinates of the Pointer when it was first pressed down on the Sprite.
This sprite might have been destroyed during the onInputDown event. Check to see if it was.
Also, set the pointer's dirty flag before the altered if-block just in case the function returns.
- Impact: none/foward-migration; fully backwards compatible
- Moves the key code constants in Keyboard to a KeyCode type.
- Duplicates the KeyCodes in the Keyboard object for backward
compatiblity.
- KeyCode properties are listed in documentation
- Updates documentaion to refer to Phaser.KeyCode
- Adds in future 'keycode' expansion capabilities,
as indicated by the KeyCode documentation, if the constants
are used in code.
Closes#2031
Impact:
- *none for touch devices*
- *low* / 'expected behavior' for mouse devices
Adds a PointerMode enumeration value for better simple input
discrimination in the future.
The added Button#justReleasedPreventsOver controls if a just-release event
on a pointer prevents it from being able to trigger an over event.
The default value is PointerMode.CONTACT which means this 'release guard'
applies only to touch inputs.
It should fix#2062 as Mouse (PointerMode.CURSOR) input is not caught in the default.
Also expands Button#forceOut to accept a PointerMode value such that it
can be controlled per-input mode.
This is a configurable partial revert of a possibly rogue commit in 2.1.3
and the behavior persists through 2.4.3.
- Impact: none; documentation and local variable names only
- Incorrect documentation that claimed to take a Pointer when they really
took a Pointer ID is fixed
- Also updates parameter names for consistenct/clarity
Event listeners added with true passed in as the useCapture flag are only removed when true is also passed into the removeEventListener call. Adding this flag to the stop method where appropriate fixes a memory leak in IE where events on window are never removed.
See https://msdn.microsoft.com/en-us/library/ff975250(v=vs.85).aspx
* MSPointer now has an `onPointerUpGlobal` handler for when the pointer is released outside of the canvas, but still within the browser window. This means that in IE11 a Sprites `onInputUp` event will now trigger even when outside the canvas (thanks @bvargish #2000)
* MSPointer now has handles for the pointer being over and outside of the canvas element, which sets the Pointer.withinGame booleans accordingly. It also triggers the Mouse.mouseOutCallback and Mouse.mouseOverCallback callbacks respectively.
* The MSPointer event listeners have been renamed to all lower-case, i.e. 'pointerDown' is now 'pointerdown'.