ui-lit
Version:
UI Elements on LIT
15 lines (14 loc) • 410 B
JavaScript
export class KeyDownController {
constructor(host) {
this.handlekeyDown = (e) => {
this.host.handlekeyDown(e);
};
(this.host = host).addController(this);
}
hostConnected() {
document.addEventListener("keydown", this.handlekeyDown);
}
hostDisconnected() {
document.removeEventListener("keydown", this.handlekeyDown);
}
}