add keystroke hints
This commit is contained in:
@@ -65,6 +65,7 @@ export default class CoreViewModel {
|
||||
if (!(e instanceof KeyboardEvent))
|
||||
return console.trace("NOT A KEY EVENT");
|
||||
if (CoreViewModel.checkIsKeystroke(e) == false) return;
|
||||
document.body.setAttribute("keystroke-active", "");
|
||||
e.preventDefault();
|
||||
const contexts: Context[] = this.contexts;
|
||||
while (contexts.length > 0) {
|
||||
@@ -75,6 +76,10 @@ export default class CoreViewModel {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyUp = (): void => {
|
||||
document.body.removeAttribute("keystroke-active");
|
||||
};
|
||||
|
||||
// CHRON
|
||||
chronHandlerManager = new HandlerManager<void>();
|
||||
todayDate = new React.State<Date>(new Date());
|
||||
@@ -154,6 +159,7 @@ export default class CoreViewModel {
|
||||
});
|
||||
|
||||
document.body.addEventListener("keydown", this.handleKeyDown);
|
||||
document.body.addEventListener("keyup", this.handleKeyUp);
|
||||
|
||||
window.onpopstate = () => {
|
||||
if (!this.context) return;
|
||||
|
||||
Reference in New Issue
Block a user