+import {Component} from './component';
+
/**
* Keys to ignore when recording shortcuts.
* @type {string[]}
*/
const ignoreKeys = ['Control', 'Alt', 'Shift', 'Meta', 'Super', ' ', '+', 'Tab', 'Escape'];
-/**
- * @extends {Component}
- */
-class ShortcutInput {
+export class ShortcutInput extends Component {
setup() {
this.input = this.$el;
this.listenerRecordKey = this.listenerRecordKey.bind(this);
this.input.addEventListener('focus', () => {
- this.startListeningForInput();
+ this.startListeningForInput();
});
this.input.addEventListener('blur', () => {
this.stopListeningForInput();
- })
+ });
}
startListeningForInput() {
- this.input.addEventListener('keydown', this.listenerRecordKey)
+ this.input.addEventListener('keydown', this.listenerRecordKey);
}
/**
}
}
-
-export default ShortcutInput;
\ No newline at end of file