mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
update patch notes.
This commit is contained in:
@@ -8,6 +8,11 @@ export function KeyHandler(props: IProps): React.ReactElement {
|
||||
let elem: any;
|
||||
useEffect(() => elem.focus());
|
||||
|
||||
function onKeyDown(event: React.KeyboardEvent<HTMLElement>): void {
|
||||
if(!event.isTrusted) return;
|
||||
props.onKeyDown(event);
|
||||
}
|
||||
|
||||
// invisible autofocused element that eats all the keypress for the minigames.
|
||||
return (<div tabIndex={1} ref={c => elem = c} onKeyDown={props.onKeyDown} />)
|
||||
return (<div tabIndex={1} ref={c => elem = c} onKeyDown={onKeyDown} />)
|
||||
}
|
||||
Reference in New Issue
Block a user