1234567891011121314151617 |
- import EventSystem from './EventSystem';
- export default class Keyboard extends EventSystem{
- constructor(){
- super()
- this.keys = {};
- window.addEventListener('onkeypress', (e) => this.press(pliktro) )
- }
- listen() {
- window.addEventListener('keydown',(e) => {
- //TODO add functionality
- this.emit(e.key)
- })
- return this;
- }
- }
|