Volume and brighness adjustment OSD delay and screen freeze on Ubuntu 18.04
The accepted answer to this other question of mine https://askubuntu.com/a/1163929/834984 also solved this problem.
Copied below the relevant part of the answer: "After some digging i found out the culprit is the ScrollLock key and that can be fixed by editing the layout file, which in my case is found at /usr/share/X11/xkb/symbols/br. The only modification i did was to remove or comment the line: modifier_map Mod3 { Scroll_Lock }; After that, set the language and layout back to Portugues (Brasil) and the problem was gone!"
Thank you Gustavo Silva
Deleting the line
modifier_map Mod3 { Scroll_Lock };
at /usr/share/X11/xkb/symbols/br
only worked for me after deleting the US keyboard input and adding it again, not just switching between them.
Now there still seems to be a delay, but it is very small and acceptable.