There are numerous articles that talk about keyboard input lag (i.e. https://www.makeuseof.com/windows-10-fix-keyboard-lag/), but I'm not sure if any of the suggestions will help you. One person said that Razor Cortex caused their issues, which was fixed after uninstalling it. Another person said Windows Defender was the cause due to the real-time monitoring process. So there are a couple of things you can try with that.
Mike
Mike