123456789101112131415161718192021222324252627282930 |
- import EventSystem from './EventSystem';
- export default class Mouse extends EventSystem{
- constructor(container = window){
- super()
- this.container = container;
- }
- listen(){
- console.log(this)
- this.container.addEventListener('mousedown',(e) => {
- switch(e.button){
- case 0:
- this.emit('LeftDown',e);
- break;
- case 2:
- this.emit('RightDown',e);
- break;
- default:
- console.log('sss')
- break;
- }
- })
- return this;
- }
- }
|