Infiltration rework (#1010)

Infiltration 2
This commit is contained in:
hydroflame
2021-06-13 11:05:40 -04:00
committed by GitHub
parent 39b4048603
commit 19f51b684b
39 changed files with 1555 additions and 1263 deletions
+13
View File
@@ -0,0 +1,13 @@
import React, { useEffect } from 'react';
interface IProps {
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
}
export function KeyHandler(props: IProps): React.ReactElement {
let elem: any;
useEffect(() => elem.focus());
// invisible autofocused element that eats all the keypress for the minigames.
return (<div tabIndex={1} ref={c => elem = c} onKeyDown={props.onKeyDown} />)
}