Touch Manager will now handle focus events as well.

This commit is contained in:
Richard Davey 2018-11-28 13:13:44 +00:00
parent 5623515c41
commit f2de618b24

View file

@ -174,9 +174,15 @@ var TouchManager = new Class({
startListeners: function ()
{
var _this = this;
var autoFocus = (window && window.focus && this.manager.game.config.autoFocus);
this.onTouchStart = function (event)
{
if (autoFocus)
{
window.focus();
}
if (event.defaultPrevented || !_this.enabled || !_this.manager)
{
// Do nothing if event already handled