feat(3d-nds): lag detection

This commit is contained in:
2026-02-24 16:17:43 +01:00
parent 187cc8d574
commit 2d4210b031
6 changed files with 78 additions and 2 deletions

View File

@@ -7,7 +7,11 @@ export type KeyDownCallback = (params: {
}) => void;
export const useKeyDown = (callback: KeyDownCallback) => {
const app = useAppStore();
const handleKeyDown = (event: KeyboardEvent) => {
if (app.lagDetected) return;
const ndsButton = mapCodeToNDS(event.code);
callback({
key: ndsButton ? `NDS_${ndsButton}` : event.key,