refactor: events

This commit is contained in:
cha0s 2022-06-08 12:31:51 -05:00
parent a0a3180eb9
commit 5f5f998543
2 changed files with 6 additions and 4 deletions

View File

@ -45,6 +45,11 @@ export default class InputNormalizer extends decorate(Class) {
this.stopListening();
}
emit(...args) {
super.emit(...['*', ...args]);
super.emit(...args);
}
listen(target = window.document, targetForKeyUp = window.document) {
// Only listen once.
if (this.target) {

View File

@ -76,11 +76,8 @@ export default () => class Controllable extends decorate(Trait) {
},
listenForInput: (inputNormalizer) => {
inputNormalizer.on('*', (...args) => this.entity.emit(...args));
this.$$actionRegistry.listen(inputNormalizer);
// @todo leak
inputNormalizer.on('pointerMove', (event) => {
this.entity.emit('pointerMove', event);
});
},
};