Bug fix: check ui.textureFactoryEvent exists
Key events