add keystroke hints

This commit is contained in:
marlon-erler
2026-09-29 22:24:34 +02:00
parent 7a532bbf5c
commit d3f3a1db21
25 changed files with 494 additions and 266 deletions
+6
View File
@@ -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;