Hi @Frank99,
your post is difficult to read. Help us to help you by surrounding your code with backticks to preserve indentation.
Without reading your code too closely (because it is difficult to understand in this format), I see that you check the keyboard and then update a text component’s text attribute. You could check a timer and only query the keyboard, if the timer says that the 5 secs are over. Would that solve the problem?