Skip to content

Commit 144cfaf

Browse files
committed
Previously the Input Manager would create a Touch handler unless the Game Config had input.touch set to false (the default was true). If no such property is set, it no longer defaults to true and instead is set to whatever Device.input.touch returns. On non-touchscreen desktops this means it will now only create one single Pointer, rather than two.
1 parent f3b35f0 commit 144cfaf

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Most of the updates were about documentation and module namespacing, however tho
189189
* The Tilemap `createFromObjects` method will now add custom properties to the Game Objects. It works by checking if the property exists or not, and if not, it sets it in the Game Objects Data Manager (thanks @scalemailted @samme)
190190
* In Matter.js if you scaled a Body it would only scale correctly once, due to the way Matter handles scaling internally. We now automatically reset the Matter scale before applying the new value, which allows you to keep the Phaser and Matter object scales in sync. Fix #3785 #3951 (thanks @bergben)
191191
* The default Container Blend Mode is now `SKIP_TEST`. This allows you to either set a blend mode for a Container, in which case all children use that blend mode. Or, you can set a blend mode on the children and the children will render using their own blend modes, as the Container doesn't have one set. The WebGL and Canvas Renderer functions have also been updated to support this change. Fix #3684 (thanks @TadejZupancic)
192+
* Previously the Input Manager would create a Touch handler unless the Game Config had `input.touch` set to `false` (the default was true). If no such property is set, it no longer defaults to `true` and instead is set to whatever `Device.input.touch` returns. On non-touchscreen desktops this means it will now only create one single Pointer, rather than two.
192193

193194
### Game Config Resolution Specific Bug Fixes
194195

src/boot/Config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
var Class = require('../utils/Class');
88
var CONST = require('../const');
9+
var Device = require('../device');
910
var GetFastValue = require('../utils/object/GetFastValue');
1011
var GetValue = require('../utils/object/GetValue');
1112
var IsPlainObject = require('../utils/object/IsPlainObject');
@@ -367,7 +368,7 @@ var Config = new Class({
367368
/**
368369
* @const {boolean} Phaser.Boot.Config#inputTouch - [description]
369370
*/
370-
this.inputTouch = GetValue(config, 'input.touch', true);
371+
this.inputTouch = GetValue(config, 'input.touch', Device.input.touch);
371372

372373
/**
373374
* @const {?*} Phaser.Boot.Config#inputTouchEventTarget - [description]

0 commit comments

Comments
 (0)