non-ASCII symbols blocking

Hi, there!
How do I can block the typing of all non-acsii symbols?
I supose that using of “keymap.of” will help but how it being use correct?

You cannot do this with a keymap. A transaction filter that checks inserted text and blocks changes that introduce undesired characters is probably the best way to do such a thing.

I did it by a transaction filter as you advised, thank you very much