Yeah, what you're doing is polling for the state of 255 keys, one at a time. That's extremely inefficient and slow.
You would be much better off implementing a
global keyboard hook[
^]. That means your code is celled every time a key is made or broken.
The polling code you wrote will never run fast enough to keep pace with a fast typist. There will always be someone who can type faster.