feat(3d-nds): lag detection
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user