3 ms·
I think it's not lag -- it's that on `keydown`, the value of `hidInput` doesn't yet reflect the new input from the pressed key. Seems like on `input` would do
by montroser 5y ago
I think it's not lag -- it's that on `keydown`, the value of `hidInput` doesn't yet reflect the new input from the pressed key. Seems like on `input` would do better for that event listener...
- James-Livesey 5y agoShould all be fixed now! See https://github.com/James-Livesey/atto/pull/7 https://github.com/James-Livesey/atto/pull/7 for more details. In the end, using `input` still wasn't sufficient to fix the lag, so instead I 'bodged' the delay before rendering happens by adding a 10 ms wait between keydown and render. But yes, you were right in thinking that `hidInput` wasn't 'ready' for the renderer to get the value of!