12345678910111213141516171819 |
- 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);
- this.emit(e.keyCode);
- });
-
- return this;
- }
- }
|