Richard Davey
d36c8177b5
Update InputManager.js
2021-12-01 13:15:27 +00:00
Richard Davey
c0d2d1d35e
Removed over and out events as no browser supports them. Tidied up the rest. Added isTop property.
2021-11-30 22:38:26 +00:00
Richard Davey
1273145a6b
When the Pointer moves out of the canvas and is released it would trigger Uncaught TypeError: Cannot read properties of undefined (reading 'renderList')
if multiple children existed in the pointer-out array. Fix #5867
2021-11-30 20:29:16 +00:00
404
3a3f479196
fix: The window touchcancel event is not removed
2021-11-08 16:13:59 +08:00
Richard Davey
68550dbddb
Update Key.js
2021-11-02 22:54:17 +00:00
Richard Davey
3e1d77ad8f
The KeyboardPlugin.removeKey
method has a new optional parameter removeCapture
. This will remove any keyboard capture events for the given Key. Fix #5693
2021-11-01 18:13:51 +00:00
Richard Davey
c391ad6c87
Check if still input enabled
2021-10-26 18:24:06 +01:00
Sylvain Pollet-Villard
dca5346573
types: JSDoc for Phaser.Input.Gamepad.Configs
2021-07-08 23:53:58 +02:00
Richard Davey
f802ac5d8c
The Input.Pointer.event
property can now be a WheelEvent
as well.
2021-05-03 18:15:20 +01:00
samme
9e4d693481
Docs: fix type for KeyboardPlugin#manager
2021-04-02 10:31:49 -07:00
Richard Davey
29d38b3283
Updated docs
2021-03-24 16:36:22 +00:00
Ben Randall
e0f26f6b9d
Remove and destry all Keys in Scene.Shutdown()
2021-03-17 20:01:24 -07:00
Richard Davey
616566c35a
Renamed sortGameObjects
to sortDropZones
and then repurposed the old method for the new render list sorting technique.
2021-01-07 12:32:00 +00:00
cjw6k
19c2874166
Added prevType to constructor.
2020-12-28 17:37:54 -04:00
cjw6k
8771c81649
Check event.type in duplicate event bailout
...
Fixes #5471 .
2020-12-27 17:24:14 -04:00
Richard Davey
417f7684c3
More integer to number changes
2020-11-23 10:32:00 +00:00
Richard Davey
3f511a73cd
Replace integer[] with number[]
2020-11-23 10:23:10 +00:00
Richard Davey
02c34cd64e
Replace integer with number
2020-11-23 10:22:13 +00:00
Richard Davey
619fd18028
MouseManager.preventDefaultWheel
is a new boolean property, set via the inputMousePreventDefaultWheel
config option that allows you to toggle capture of mouse wheel at runtime.
2020-10-07 10:14:02 +01:00
Richard Davey
a16ab01e22
MouseManager.isTop
is a new boolean read-only property that flags if the mouse event listeners were attached to window.top
(true), or just window
(false). By default Phaser will attempt window.top
, but this isn't possible in all environments, such as cross-origin iframes, so it will fall back to window
in those cases and set this property to false
2020-10-05 10:40:35 +01:00
Richard Davey
0fb0c094c6
Removed inner loop
2020-10-05 08:07:06 +01:00
Richard Davey
76deec0ef6
When destroying an interactive Game Object that had useHandCursor
enabled, it would reset the CSS cursor to default, even if the cursor wasn't over that Game Object. It will now only reset the cursor if it's over the Game Object being destroyed. Fix #5321
...
The `InputPlugin.shutdown` method will now reset the CSS cursor, in case it was set by any Game Objects in the Scene that have since been destroyed.
2020-09-22 22:40:56 +01:00
Richard Davey
aea0e4c925
Pointer.down
will now check if the browser is running under macOS and if the ctrl key was also pressed, if so, it will flag the down event as being a right-click instead of a left-click, as per macOS conventions. Fix #4245
2020-09-22 20:42:38 +01:00
samme
08b2ea467b
Docs: correct CursorKeys
...
Properties not optional
2020-09-18 08:57:05 -07:00
Richard Davey
b63cc75154
Remove Camera.resolution use
2020-09-12 11:55:38 +01:00
Richard Davey
f2fca49b3f
Remove Camera resolution use
2020-09-12 11:55:26 +01:00
Richard Davey
2acfbfbe71
Gamepad._created
is a new private internal property that keeps track of when the instance was created. This is compared to the navigator timestamp in the update loop to avoid event spamming. Fix #4890 .
2020-09-11 14:01:55 +01:00
Richard Davey
5ecdc3b4a2
The GamepadPlugin
will now call refreshPads
as part of its start process. This allows you to use Gamepads across multiple Scenes, without having to wait for a connected event from each one of them. If you've already had a connected event in a previous Scene, you can now just read the pads directly via this.input.gamepad.pad1
and similar. Fix #4890
2020-09-11 14:00:14 +01:00
Richard Davey
57657ce76c
Updated JSDocs. Fix #5268
2020-09-11 11:08:43 +01:00
Richard Davey
56bbfbcb62
Removed capture
and added preventDefaultDown
, Up
and Move
instead. Also better passive handling and smaller listeners.
2020-09-11 10:59:47 +01:00
Richard Davey
a04690d5af
The onMouse
events in the Input Manager didn't reset the activePointer
property to the mouse, meaning on dual-input systems such as Touch Screen devices, the active pointer would become locked to whichever input method was used first. Fix #4615 #5232
2020-09-11 09:48:13 +01:00
Richard Davey
205552d69c
Fix namespaces. Fix #5289
2020-09-10 17:04:56 +01:00
Richard Davey
5e9b629a97
Merge pull request #5284 from samme/feature/scene-resume-wake-reset-keys
...
Reset keys when scene sleeps or pauses
2020-09-02 21:50:42 +01:00
samme
288d023bab
Reset keys when scene sleeps or pauses #5281
2020-09-01 12:42:57 -07:00
Richard Davey
d2cc809fdb
Exported functions to namespace
2020-09-01 18:56:01 +01:00
Richard Davey
02ac6bcb7d
If inputWindowEvents
is set in the Game Config, then the MouseManager
will now listen for the events on window.top
instead of just window
, which should help in situations where the pointer is released outside of an embedded iframe. Fix #4824
2020-09-01 17:51:17 +01:00
Richard Davey
e93d36f38e
The Pointer.getDuration
method now uses the new Pointer downTime
and upTime
values, meaning it will accurately report the duration of when any button is being held down, not just the primary one. Fix #5112
...
* `Pointer.downTime` now stores the event timestamp of when the first button on the input device was pressed down, not just when button 1 was pressed down.
* `Pointer.upTime` now stores the event timestamp of when the final depressed button on the input device was released, not just when button 1 was released.
2020-08-24 17:32:21 +01:00
samme
981a4b1a0a
Rename all setInteractive() arguments, and docs
2020-08-03 13:33:30 -07:00
Richard Davey
0d04e40e28
Updated jsdocs
2020-08-03 17:54:40 +01:00
Richard Davey
2810396dc7
The KeyboardPlugin
will now track the key code and timestamp of the previous key pressed and compare it to the current event. If they match, it will skip the event. On some systems if you were to type quickly, you would sometimes get duplicate key events firing (the exact same event firing more than once). This is now prevented from happening.
2020-08-01 21:06:42 +01:00
Richard Davey
c4000843ec
The KeyboardManager
and KeyboardPlugin
were both still checking for the InputManager.useQueue
property, which was removed several versions ago.
2020-08-01 20:54:45 +01:00
Richard Davey
fccd00e8c5
Remove deprecated events
2020-08-01 20:32:50 +01:00
Richard Davey
6c7437cdc4
Merge pull request #5198 from samme/feature/KeyboardPlugin-removeAllKeys
...
Add KeyboardPlugin#removeAllKeys
2020-07-13 13:04:53 +01:00
Richard Davey
a7ded1ee21
KeyboardPlugin.checkDown
didn't set the duration
to zero if the parameter was omitted, causing it to always return false. Fix #5146
2020-07-13 12:12:28 +01:00
Richard Davey
9a34fa9197
Merge pull request #5171 from samme/fix/input-noop
...
Fix NOOP import
2020-07-13 11:42:32 +01:00
Jay Mattis
c5cfae0118
Fix drag coordinates with camera zoom (issue 4755)
...
The dragX and dragY passed to 'dragStart' and 'drag' events are supported to be in world coordinates (as specified by the docs) but the coordinates used (pointer.x and pointer.y) were not transformed by the camera into world space. The drags now use pointer.worldX and pointer.worldY which are the post-transform coordinates.
2020-07-12 21:13:33 -07:00
samme
af141f6bf0
Add KeyboardPlugin#removeAllKeys
2020-06-23 11:58:26 -07:00
samme
4722750f62
Fix NOOP import
...
Fixes #5170
2020-05-27 18:20:05 -07:00
Richard Davey
afe3d7ff7b
Update InputPlugin.js
2020-04-27 16:40:33 +01:00
Richard Davey
2d05802125
Merge pull request #4851 from rexrainbow/Input-event-of-container-bug
...
Fix input-event bug in nested container
2020-04-27 13:50:16 +01:00