Intermittent input delay on keyboard (MacBook Pro 2018)
I think I remember a problem from long ago related to the Dock. Try opening /Applications/Utilities/Terminal, then executing "killall Dock" (It comes right back). This may just be a workaround and you might have to do it whenever you experience the problem.